summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstring.h
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2008-05-19 17:02:33 +0000
committerDon Kjer <don@lindenlab.com>2008-05-19 17:02:33 +0000
commit38558960978a0741dd9c79c4c7a108b8a1f99eff (patch)
treeb7221183a7c91c1097a78cf5875197431852b0b8 /indra/llcommon/llstring.h
parente77de5d685ae441f72920f0e04d9887ee958745a (diff)
EFFECTIVE MERGES:
svn merge -r 79616:82632 svn+ssh://svn/svn/linden/branches/maintenance/maintenance-7 into release svn merge -r 83211:87215 svn+ssh://svn/svn/linden/branches/php-framework-3 into release ACTUAL MERGE: svn merge -r 87631:87698 svn+ssh://svn/svn/linden/qa/combo-merge-maintenance-7-php-framework-3 into release dataserver-is-deprecated
Diffstat (limited to 'indra/llcommon/llstring.h')
-rw-r--r--indra/llcommon/llstring.h116
1 files changed, 4 insertions, 112 deletions
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 88d7e88edc..8a1e1fe8cb 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -39,15 +39,8 @@
const char LL_UNKNOWN_CHAR = '?';
-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)
+#if LL_DARWIN || LL_LINUX || LL_SOLARIS
+// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
namespace std
{
template<>
@@ -166,13 +159,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>
@@ -196,35 +189,6 @@ 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(); }
@@ -787,78 +751,6 @@ 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)