OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
String.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGTEXT_STRING
15 #define OSGTEXT_STRING 1
16 
17 #include <vector>
18 #include <set>
19 #include <string>
20 
21 #include <osgText/Export>
22 
23 namespace osgText {
24 
25 // ******************************** HACK **********************************
26 // Following class is needed to work around a DLL export problem. See file
27 // include/osg/PrimitiveSet for details.
28 
29 class VectorUInt: public std::vector<unsigned int>
30 {
31  typedef std::vector<value_type> vector_type;
32 public:
33  VectorUInt(): vector_type() {}
34  VectorUInt(const VectorUInt &copy): vector_type(copy) {}
35  VectorUInt(unsigned int* beg, unsigned int* end): vector_type(beg, end) {}
36  explicit VectorUInt(unsigned int n): vector_type(n) {}
37 };
38 
39 // **************************************************************************
40 
41 class Text;
42 
44 {
45  public:
46 
48 
52  enum Encoding
53  {
55  ENCODING_ASCII = ENCODING_UNDEFINED,
63  ENCODING_SIGNATURE
64  };
65 
66 
67  String() {}
68  String(const String& str);
69  String(const std::string& str) { set(str); }
70  String(const wchar_t* text) { set(text); }
71  String(const std::string& text,Encoding encoding) { set(text,encoding); }
72 
73  String& operator = (const String& str);
74 
75  void set(const std::string& str);
76 
79  void set(const wchar_t* text);
80 
83  void set(const std::string& text,Encoding encoding);
84 
86  std::string createUTF8EncodedString() const;
87 
88  protected:
89 
90 };
91 
92 }
93 
94 
95 #endif
VectorUInt(unsigned int n)
Definition: String.h:36
String(const std::string &text, Encoding encoding)
Definition: String.h:71
VectorUInt(const VectorUInt &copy)
Definition: String.h:34
String(const std::string &str)
Definition: String.h:69
32-bit big-endian
Definition: String.h:62
unsigned char ASCII
Definition: String.h:56
VectorUInt vector_type
Definition: String.h:47
VectorUInt(unsigned int *beg, unsigned int *end)
Definition: String.h:35
String(const wchar_t *text)
Definition: String.h:70
8-bit unicode transformation format
Definition: String.h:57
16-bit big-endian
Definition: String.h:59
16-bit little-endian
Definition: String.h:60
#define OSGTEXT_EXPORT
Definition: Export.h:39