Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Greek Class Reference

#include <utf8.h>

Collaboration diagram for Greek:

Collaboration graph
List of all members.

Public Types

enum  Letter {
  Alpha = 1, Beta = 2, Gamma = 3, Delta = 4,
  Epsilon = 5, Zeta = 6, Eta = 7, Theta = 8,
  Iota = 9, Kappa = 10, Lambda = 11, Mu = 12,
  Nu = 13, Xi = 14, Omicron = 15, Pi = 16,
  Rho = 17, Sigma = 18, Tau = 19, Upsilon = 20,
  Phi = 21, Chi = 22, Psi = 23, Omega = 24
}

Static Public Member Functions

static const std::stringcanonicalAbbreviation (const std::string &)

Public Attributes

std::stringabbrevs
std::stringnames
int nLetters

Static Public Attributes

static Greekinstance = NULL

Private Member Functions

 Greek ()
 ~Greek ()

Member Enumeration Documentation

enum Greek::Letter
 

Enumeration values:
Alpha 
Beta 
Gamma 
Delta 
Epsilon 
Zeta 
Eta 
Theta 
Iota 
Kappa 
Lambda 
Mu 
Nu 
Xi 
Omicron 
Pi 
Rho 
Sigma 
Tau 
Upsilon 
Phi 
Chi 
Psi 
Omega 

Definition at line 74 of file utf8.h.

00074                 {
00075         Alpha     =  1,
00076         Beta      =  2,
00077         Gamma     =  3,
00078         Delta     =  4,
00079         Epsilon   =  5,
00080         Zeta      =  6,
00081         Eta       =  7,
00082         Theta     =  8,
00083         Iota      =  9,
00084         Kappa     = 10,
00085         Lambda    = 11,
00086         Mu        = 12,
00087         Nu        = 13,
00088         Xi        = 14,
00089         Omicron   = 15,
00090         Pi        = 16,
00091         Rho       = 17,
00092         Sigma     = 18,
00093         Tau       = 19,
00094         Upsilon   = 20,
00095         Phi       = 21,
00096         Chi       = 22,
00097         Psi       = 23,
00098         Omega     = 24,
00099     };


Constructor & Destructor Documentation

Greek::Greek  )  [private]
 

Definition at line 709 of file utf8.cpp.

References abbrevs, canonicalAbbrevs, greekAlphabet, names, and nLetters.

Referenced by canonicalAbbreviation().

00710 {
00711     nLetters = sizeof(greekAlphabet) / sizeof(greekAlphabet[0]);
00712     names = new std::string[nLetters];
00713     abbrevs = new std::string[nLetters];
00714 
00715     for (int i = 0; i < nLetters; i++)
00716     {
00717         names[i] = std::string(greekAlphabet[i]);
00718         abbrevs[i] = std::string(canonicalAbbrevs[i]);
00719     }
00720 }

Greek::~Greek  )  [private]
 

Definition at line 722 of file utf8.cpp.

References abbrevs, and names.

00723 {
00724     delete[] names;
00725     delete[] abbrevs;
00726 }


Member Function Documentation

const std::string & Greek::canonicalAbbreviation const std::string  )  [static]
 

Definition at line 728 of file utf8.cpp.

References abbrevs, compareIgnoringCase(), Greek(), greekAlphabetUTF8, instance, names, nLetters, and noAbbrev().

Referenced by StarNameDatabase::findCatalogNumberByName().

00729 {
00730     if (instance == NULL)
00731         instance = new Greek();
00732 
00733     int i;
00734     for (i = 0; i < Greek::instance->nLetters; i++)
00735     {
00736         if (compareIgnoringCase(letter, instance->names[i]) == 0)
00737             return instance->abbrevs[i];
00738     }
00739 
00740     for (i = 0; i < Greek::instance->nLetters; i++)
00741     {
00742         if (compareIgnoringCase(letter, instance->abbrevs[i]) == 0)
00743             return instance->abbrevs[i];
00744     }
00745 
00746     if (letter.length() == 2)
00747     {
00748         for (i = 0; i < Greek::instance->nLetters; i++)
00749         {
00750             if (letter[0] == greekAlphabetUTF8[i][0] &&
00751                 letter[1] == greekAlphabetUTF8[i][1])
00752             {
00753                 return instance->abbrevs[i];
00754             }
00755         }
00756     }
00757 
00758     return noAbbrev;
00759 }


Member Data Documentation

std::string* Greek::abbrevs
 

Definition at line 107 of file utf8.h.

Referenced by canonicalAbbreviation(), Greek(), ReplaceGreekLetterAbbr(), and ~Greek().

Greek * Greek::instance = NULL [static]
 

Definition at line 707 of file utf8.cpp.

Referenced by canonicalAbbreviation().

std::string* Greek::names
 

Definition at line 106 of file utf8.h.

Referenced by canonicalAbbreviation(), Greek(), and ~Greek().

int Greek::nLetters
 

Definition at line 105 of file utf8.h.

Referenced by canonicalAbbreviation(), and Greek().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:21 2006 for Celestia by  doxygen 1.4.1