00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEHASHSTRING_H
00028 #define __NEHASHSTRING_H
00029
00030
00037 #include "base.h"
00038 #include "hash.h"
00039
00040 #include <string>
00041
00042
00043 namespace NeoEngine
00044 {
00045
00046
00057 class NEOENGINE_API HashString
00058 {
00059 protected:
00060
00062 unsigned int m_uiHash;
00063
00064
00065 public:
00066
00068 std::string m_strData;
00069
00070
00074 inline HashString();
00075
00080 inline HashString( const HashString &rstrRef );
00081
00086 inline HashString( const std::string &rstrRef );
00087
00093 inline HashString( const char *pcRef, int iNum );
00094
00099 inline HashString( const char *pszRef );
00100
00106 inline HashString( int iNum, const char cData );
00107
00113 inline bool Compare( const HashString &rstrRef ) const;
00114
00120 inline bool Compare( unsigned int uiHash ) const;
00121
00125 inline unsigned int GetHash() const;
00126
00131 inline HashString &HashMe();
00132
00136 inline size_t length() const;
00137
00141 inline const char *c_str() const;
00142
00148 inline bool operator == ( const HashString &rstrRef ) const;
00149
00155 inline bool operator == ( unsigned int uiHash ) const;
00156
00162 inline bool operator == ( const std::string &rstrRef ) const;
00163
00169 inline bool operator == ( const char *pszRef ) const;
00170
00176 inline bool operator != ( const HashString &rstrRef ) const;
00177
00183 inline bool operator != ( unsigned int uiHash ) const;
00184
00190 inline bool operator != ( const std::string &rstrRef ) const;
00191
00197 inline bool operator != ( const char *pszRef ) const;
00198
00204 inline HashString &operator = ( const HashString &rstrRef );
00205
00211 inline HashString &operator = ( const std::string &rstrRef );
00212
00218 inline HashString &operator = ( const char *pszRef );
00219
00225 inline HashString &operator += ( const HashString &rstrRef );
00226
00232 inline HashString &operator += ( const std::string &rstrRef );
00233
00239 inline HashString &operator += ( const char *pszRef );
00240
00244 inline operator std::string &();
00245
00249 inline operator const std::string &() const;
00250
00256 inline bool operator < ( const HashString &rstrString ) const;
00257 };
00258
00259
00266 NEOENGINE_API std::ostream &operator << ( std::ostream &rkStream, const HashString &rkString );
00267
00268
00275 inline HashString operator + ( const HashString &rstrOne, const HashString &rstrTwo );
00276
00277
00284 inline HashString operator + ( const HashString &rstrOne, const std::string &rstrTwo );
00285
00286
00293 inline HashString operator + ( const HashString &rstrOne, const char *pszTwo );
00294
00295
00302 inline HashString operator + ( const std::string &rstrOne, const HashString &rstrTwo );
00303
00304
00311 inline HashString operator + ( const char *pszOne, const HashString &rstrTwo );
00312
00313
00314 #include "hashstring_inl.h"
00315
00316
00317 };
00318
00319
00320 #endif