]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/filesystem/test/locale_info.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / filesystem / test / locale_info.cpp
index db57bb15883374d99031858c5e55a3ad38bf1a2c..e9a8147eb6f6cb60641df269ead8e54b53f13516 100644 (file)
 using namespace std;
 
 #ifdef _MSC_VER
-#  pragma warning(push)
-#  pragma warning(disable: 4996)  // ... Function call with parameters that may be unsafe
+#pragma warning(push)
+#pragma warning(disable : 4996) // ... Function call with parameters that may be unsafe
 #endif
 
-namespace
+namespace {
+void facet_info(const locale& loc, const char* msg)
 {
-  void facet_info(const locale& loc, const char* msg)
-  {
     cout << "has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >("
-      << msg << ") is "
-      << (has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)
-          ? "true\n"
-          : "false\n");
-  }
+         << msg << ") is "
+         << (has_facet< std::codecvt< wchar_t, char, std::mbstate_t > >(loc) ? "true\n" : "false\n");
+}
 
-  void default_info()
-  {
+void default_info()
+{
     try
     {
-      locale loc;
-      cout << "\nlocale default construction OK" << endl;
-      facet_info(loc, "locale()");
+        locale loc;
+        cout << "\nlocale default construction OK" << endl;
+        facet_info(loc, "locale()");
     }
     catch (const exception& ex)
     {
-      cout << "\nlocale default construction threw: " << ex.what() << endl;
+        cout << "\nlocale default construction threw: " << ex.what() << endl;
     }
-  }
+}
 
-  void null_string_info()
-  {
+void null_string_info()
+{
     try
     {
-      locale loc("");
-      cout << "\nlocale(\"\") construction OK" << endl;
-      facet_info(loc, "locale(\"\")");
+        locale loc("");
+        cout << "\nlocale(\"\") construction OK" << endl;
+        facet_info(loc, "locale(\"\")");
     }
     catch (const exception& ex)
     {
-      cout << "\nlocale(\"\") construction threw: " << ex.what() << endl;
+        cout << "\nlocale(\"\") construction threw: " << ex.what() << endl;
     }
-  }
+}
 
-  void classic_info()
-  {
+void classic_info()
+{
     try
     {
-      locale loc(locale::classic());
-      cout << "\nlocale(locale::classic()) copy construction OK" << endl;
-      facet_info(loc, "locale::classic()");
+        locale loc(locale::classic());
+        cout << "\nlocale(locale::classic()) copy construction OK" << endl;
+        facet_info(loc, "locale::classic()");
     }
     catch (const exception& ex)
     {
-      cout << "\nlocale(locale::clasic()) copy construction threw: " << ex.what() << endl;
+        cout << "\nlocale(locale::clasic()) copy construction threw: " << ex.what() << endl;
     }
-  }
 }
+} // namespace
 
 int main()
 {
-  const char* lang = getenv("LANG");
-  cout << "\nLANG environmental variable is "
-    << (lang ? lang : "not present") << endl;
+    const char* lang = getenv("LANG");
+    cout << "\nLANG environmental variable is "
+         << (lang ? lang : "not present") << endl;
 
-  default_info();
-  null_string_info();
-  classic_info();
+    default_info();
+    null_string_info();
+    classic_info();
 
-  return 0;
+    return 0;
 }
 
 #ifdef _MSC_VER
-#  pragma warning(pop)
+#pragma warning(pop)
 #endif