Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGIDString.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGIDSTRING_H_
00040 #define _OSGIDSTRING_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGConfig.h>
00046 #include <OSGBase.h>
00047 #include <OSGBaseTypes.h>
00048 #include <string.h>
00049 #include <vector>
00050 #include <iostream>
00051 
00052 OSG_BEGIN_NAMESPACE
00053 
00054 class IDString;
00055 
00056 OSG_BASE_DLLMAPPING std::ostream &operator <<(      std::ostream  &os,
00057                                               const IDString      &obj);
00058 
00062 class OSG_BASE_DLLMAPPING IDString
00063 {
00064     /*==========================  PUBLIC  =================================*/
00065 
00066   public:
00067 
00068     enum MemType
00069     {
00070         COPY,
00071         LINK
00072     };
00073 
00074     typedef std::vector<IDString  > StringVec;
00075     typedef std::vector<IDString *> StringPVec;
00076 
00077     /*---------------------------------------------------------------------*/
00081     explicit IDString(      UInt32    size    = 0   );
00082 
00083     explicit IDString(const Char8    *str,  
00084                             MemType   memType = COPY);
00085              IDString(const IDString &obj,  
00086                             MemType   memType = COPY);
00087 
00089     /*---------------------------------------------------------------------*/
00093     virtual ~IDString(void);
00094 
00096     /*---------------------------------------------------------------------*/
00100     const Char8 *str      (      void                      ) const;
00101 
00102           bool   isEmpty  (      void                      ) const;
00103                                        
00104 
00105           void   set      (const Char8 *str, 
00106                                  MemType     memType = COPY);
00107 
00108           void   toUpper  (      void                      );
00109           void   toLower  (      void                      );
00110 
00111           UInt32 getLength(      void                      ) const;
00112           void   setLength(      UInt32      length        );
00113 
00114           void   tokenize (      StringVec  &v             );
00115           void   tokenize (      StringPVec &v             );
00116 
00118     /*---------------------------------------------------------------------*/
00122     const IDString & operator =(const IDString &obj);
00123 
00125     /*---------------------------------------------------------------------*/
00129     bool operator ==(const IDString &obj) const;
00130     bool operator !=(const IDString &obj) const;
00131 
00132     bool operator < (const IDString &obj) const;
00133     bool operator > (const IDString &obj) const;
00134 
00135     bool operator >=(const IDString &obj) const;
00136     bool operator <=(const IDString &obj) const;
00137 
00139     /*=========================  PROTECTED  ===============================*/
00140 
00141   protected:
00142 
00143     /*==========================  PRIVATE  ================================*/
00144 
00145     Char8   *_str;
00146     MemType  _memType;
00147 
00148     private:
00149 
00150     friend OSG_BASE_DLLMAPPING
00151     std::ostream &operator <<(      std::ostream  &os,
00152                               const IDString      &obj);
00153 
00154 };
00155 
00156 OSG_END_NAMESPACE
00157 
00158 #include <OSGIDString.inl>
00159 #include <OSGIDStringLink.h>
00160 
00161 #endif /* _OSGSTRING_H_ */
00162 
00163 
00164 

Generated on Thu Aug 25 04:06:00 2005 for OpenSG by  doxygen 1.4.3