/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/sgx/core/text/sgxtext.hpp

*/

#ifndef SGX_CORE_TEXT_SGXTEXT_HPP
#define SGX_CORE_TEXT_SGXTEXT_HPP	1


class SGXStringEntry {
public:
	 sgxString vSingle;	 // when a single item is used (default)
	 sgxString vPlural;	 // for multiple
	 sgxHashMap<tINT32, sgxString> vOthers;	 // to support single cases (==0, or ==2, etc)
};

class SGXText {
public:
	static void					initialize();
	static tBOOL				loadResource(const sgxString &filename);
	static tBOOL				eraseStrings(const tUINT32 fromStringID, const tUINT32 toStringIDExclusive);

	static const char *			getText(const char *textString, const tINT32 number = 0);
	static const sgxString &	getText(const tUINT32 keyID, const tINT32 number=0);
	static const char *			getTextString(const tUINT32 keyID, const tINT32 number= 0);

protected:
	static const sgxString &	getText(const SGXStringEntry *pEntry, const tINT32 number = 0);

private:
	static sgxHashMap<tUINT32, SGXStringEntry *> *byHash;
	static sgxHashMap<tUINT32, SGXStringEntry *> *byID;

};

#endif	//SGX_CORE_TEXT_SGXTEXT_HPP

