00001 /* 00002 * Copyright 2006 Sony Computer Entertainment Inc. 00003 * 00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website 00005 * http://www.opensource.org/licenses/mit-license.php 00006 * 00007 */ 00008 00009 #ifndef __DAE_STRING_REF_H__ 00010 #define __DAE_STRING_REF_H__ 00011 00012 #include <dae/daeMemorySystem.h> 00013 #include <dae/daeStringTable.h> 00014 00018 class daeStringRef 00019 { 00020 public: 00024 DAE_ALLOC 00025 private: 00026 daeString _string; 00027 static daeStringTable &_stringTable(); 00028 public: 00029 00033 inline ~daeStringRef() { _string = NULL; } 00034 00038 inline daeStringRef() { _string = NULL; } 00039 00044 inline daeStringRef(const daeStringRef& other) { 00045 _string = other._string; } 00046 00051 DLLSPEC daeStringRef(daeString string); 00052 00058 inline const daeStringRef& operator= (const daeStringRef& other) { 00059 _string = other._string; 00060 return *this; 00061 } 00062 00068 DLLSPEC const daeStringRef& set(daeString string); 00069 00075 DLLSPEC const daeStringRef& operator= (daeString string); 00076 00080 inline operator daeString() const { return _string; } 00081 00088 inline bool operator==(const daeStringRef& other) const{ 00089 //return (other._string == _string); } 00090 return (!strcmp(other._string, _string)); } 00091 00092 //Contributed by Nus - Wed, 08 Nov 2006 00096 static void releaseStringTable(void); 00097 //-------------------- 00098 }; 00099 00100 typedef daeTArray<daeStringRef> daeStringRefArray; 00101 typedef daeTArray<daeStringRefArray> daeStringRefArrayArray; 00102 00103 #endif //__DAE_STRING_REF_H__