Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Locale_ss.h
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2006. All Rights Reserved.
4 
5  SUBSYSTEM: nGenEx.lib
6  FILE: Locale.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Description of locale by ISO language, country, and variant
13 */
14 
15 #ifndef Locale_h
16 #define Locale_h
17 
18 #include "List.h"
19 #include "Text.h"
20 
21 // +--------------------------------------------------------------------+
22 
23 class Locale
24 {
25 public:
26  static const char* TYPENAME() { return "Locale"; }
27 
28  Locale(const char* language, const char* country=0, const char* variant=0);
29  ~Locale();
30 
31  int operator == (const Locale& that) const;
32 
33  // Operations:
34  static const List<Locale>& GetAllLocales();
35  static Locale* ParseLocale(const char* str);
36 
37  // Property accessors:
38  const char* GetLanguage() const { return language; }
39  const char* GetCountry() const { return country; }
40  const char* GetVariant() const { return variant; }
41  const Text GetFullCode() const;
42  const Text GetDisplayName() const;
43 
44 
45 protected:
46  static Locale* CreateLocale(const char* language, const char* country=0, const char* variant=0);
47  char language[8];
48  char country[8];
49  char variant[8];
50 };
51 
52 #endif Locale_h
53