• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  // Copyright 2019 The Chromium Authors. All rights reserved.
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 THIRD_PARTY_BASE_TEST_SCOPED_LOCALE_H_
6  #define THIRD_PARTY_BASE_TEST_SCOPED_LOCALE_H_
7  
8  #include <string>
9  
10  namespace pdfium {
11  namespace base {
12  
13  // Sets the given |locale| on construction, and restores the previous locale
14  // on destruction.
15  class ScopedLocale {
16   public:
17    explicit ScopedLocale(const std::string& locale);
18    ~ScopedLocale();
19  
20   private:
21    std::string prev_locale_;
22  
23    ScopedLocale(const ScopedLocale&) = delete;
24    ScopedLocale& operator=(const ScopedLocale&) = delete;
25  };
26  
27  }  // namespace base
28  }  // namespace pdfium
29  
30  #endif  // THIRD_PARTY_BASE_TEST_SCOPED_LOCALE_H_
31