diff options
author | Brian McGroarty <soft@lindenlab.com> | 2008-05-07 20:48:38 +0000 |
---|---|---|
committer | Brian McGroarty <soft@lindenlab.com> | 2008-05-07 20:48:38 +0000 |
commit | d273ba2ce2707c6a2fe45c08fdc2524aae19ad00 (patch) | |
tree | 56b3723fed44031e888de9019b1ad127acdb1806 /indra/llcommon | |
parent | e1e1212daae33723e7da325f295a5c3a6bb78979 (diff) |
Back out QAR-520 maintenance-7 merge -- svn merge -r 86947:86946 svn+ssh://svn.lindenlab.com/svn/linden/release dataserver-is-deprecated
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llapp.cpp | 1 | ||||
-rw-r--r-- | indra/llcommon/llerror.cpp | 15 | ||||
-rw-r--r-- | indra/llcommon/lllslconstants.h | 3 | ||||
-rw-r--r-- | indra/llcommon/llstring.h | 116 |
4 files changed, 121 insertions, 14 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 2c7c7e38a4..d034334aab 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -492,7 +492,6 @@ void LLApp::setDefaultChildCallback(LLAppChildCallback callback) pid_t LLApp::fork() { - fflush(NULL); // flush all buffers before the child inherits them pid_t pid = ::fork(); if( pid < 0 ) { diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 057b1bb417..13bf368334 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1006,15 +1006,18 @@ namespace LLError << "(" << site.mLine << ") : "; } + if (message.find(functionName(site.mFunction)) == std::string::npos) + { #if LL_WINDOWS - // DevStudio: __FUNCTION__ already includes the full class name + // DevStudio: __FUNCTION__ already includes the full class name #else - if (site.mClassInfo != typeid(NoClassInfo)) - { - prefix << className(site.mClassInfo) << "::"; - } + if (site.mClassInfo != typeid(NoClassInfo)) + { + prefix << className(site.mClassInfo) << "::"; + } #endif - prefix << site.mFunction << ": "; + prefix << site.mFunction << ": "; + } prefix << message; message = prefix.str(); diff --git a/indra/llcommon/lllslconstants.h b/indra/llcommon/lllslconstants.h index 12467e4e63..e4c83582ce 100644 --- a/indra/llcommon/lllslconstants.h +++ b/indra/llcommon/lllslconstants.h @@ -181,7 +181,4 @@ const S32 OBJECT_OWNER = 6; const S32 OBJECT_GROUP = 7; const S32 OBJECT_CREATOR = 8; -// llTextBox() magic token string - yes this is a hack. sue me. -const std::string TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!"; - #endif diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 8a1e1fe8cb..88d7e88edc 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -39,8 +39,15 @@ const char LL_UNKNOWN_CHAR = '?'; -#if LL_DARWIN || LL_LINUX || LL_SOLARIS -// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already) +class LLVector3; +class LLVector3d; +class LLQuaternion; +class LLUUID; +class LLColor4; +class LLColor4U; + +#if (LL_DARWIN || LL_SOLARIS || (LL_LINUX && __GNUC__ > 2)) +// Template specialization of char_traits for U16s. Only necessary on Mac for now (exists on Windows, unused/broken on Linux/gcc2.95) namespace std { template<> @@ -159,13 +166,13 @@ public: // but it might be worthwhile to just go with two implementations (LLString and LLWString) of // an interface class, unless we can think of a good reason to have a std::basic_string polymorphic base -// **************************************************************** +//**************************************************************** // NOTA BENE: do *NOT* dynamically allocate memory inside of LLStringBase as the {*()^#%*)#%W^*)#%*)STL implentation // of basic_string doesn't provide a virtual destructor. If we need to allocate resources specific to LLString // then we should either customize std::basic_string to linden::basic_string or change LLString to be a wrapper // that contains an instance of std::basic_string. Similarly, overriding methods defined in std::basic_string will *not* // be called in a polymorphic manner (passing an instance of basic_string to a particular function) -// **************************************************************** +//**************************************************************** template <class T> class LLStringBase : public std::basic_string<T> @@ -189,6 +196,35 @@ public: LLStringBase(const T* s); LLStringBase(const T* s, size_type n); LLStringBase(const T* s, size_type pos, size_type n ); + +#if LL_LINUX || LL_SOLARIS + void clear() { assign(null); } + + LLStringBase<T>& assign(const T* s); + LLStringBase<T>& assign(const T* s, size_type n); + LLStringBase<T>& assign(const LLStringBase& s); + LLStringBase<T>& assign(size_type n, const T& c); + LLStringBase<T>& assign(const T* a, const T* b); + LLStringBase<T>& assign(typename LLStringBase<T>::iterator &it1, typename LLStringBase<T>::iterator &it2); + LLStringBase<T>& assign(typename LLStringBase<T>::const_iterator &it1, typename LLStringBase<T>::const_iterator &it2); + + // workaround for bug in gcc2 STL headers. + #if ((__GNUC__ <= 2) && (!defined _STLPORT_VERSION)) + const T* c_str () const + { + if (length () == 0) + { + static const T zero = 0; + return &zero; + } + + //terminate (); + { string_char_traits<T>::assign(const_cast<T*>(data())[length()], string_char_traits<T>::eos()); } + + return data (); + } + #endif +#endif bool operator==(const T* _Right) const { return _Right ? (std::basic_string<T>::compare(_Right) == 0) : this->empty(); } @@ -751,6 +787,78 @@ LLStringBase<T>::LLStringBase(const T* s, size_type pos, size_type n ) : std::ba } } +#if LL_LINUX || LL_SOLARIS +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(const T* s) +{ + if (s) + { + std::basic_string<T>::assign(s); + } + else + { + assign(LLStringBase<T>::null); + } + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(const T* s, size_type n) +{ + if (s) + { + std::basic_string<T>::assign(s, n); + } + else + { + assign(LLStringBase<T>::null); + } + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(const LLStringBase<T>& s) +{ + std::basic_string<T>::assign(s); + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(size_type n, const T& c) +{ + std::basic_string<T>::assign(n, c); + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(const T* a, const T* b) +{ + if (a > b) + assign(LLStringBase<T>::null); + else + assign(a, (size_type) (b-a)); + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(typename LLStringBase<T>::iterator &it1, typename LLStringBase<T>::iterator &it2) +{ + assign(LLStringBase<T>::null); + while(it1 != it2) + *this += *it1++; + return *this; +} + +template<class T> +LLStringBase<T>& LLStringBase<T>::assign(typename LLStringBase<T>::const_iterator &it1, typename LLStringBase<T>::const_iterator &it2) +{ + assign(LLStringBase<T>::null); + while(it1 != it2) + *this += *it1++; + return *this; +} +#endif + //static template<class T> void LLStringBase<T>::toUpper(std::basic_string<T>& string) |