1 // Copyright 2021 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TESTING_SCOPED_SET_TZ_H_ 6 #define TESTING_SCOPED_SET_TZ_H_ 7 8 #include <string> 9 10 #include "core/fxcrt/fx_memory.h" 11 #include "third_party/abseil-cpp/absl/types/optional.h" 12 13 class ScopedSetTZ { 14 public: 15 FX_STACK_ALLOCATED(); 16 17 explicit ScopedSetTZ(const std::string& tz); 18 ScopedSetTZ(const ScopedSetTZ&) = delete; 19 ScopedSetTZ& operator=(const ScopedSetTZ&) = delete; 20 ~ScopedSetTZ(); 21 22 private: 23 absl::optional<std::string> old_tz_; 24 }; 25 26 #endif // TESTING_SCOPED_SET_TZ_H_ 27