OpenSceneGraph 3.6.5
String
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
23namespace 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
29class VectorUInt: public std::vector<unsigned int>
30{
31 typedef std::vector<value_type> vector_type;
32public:
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
41class Text;
42
44{
45 public:
46
48
66
67
68 String() {}
69 String(const String& str);
70 String(const std::string& str) { set(str); }
71 String(const wchar_t* text) { set(text); }
72 String(const std::string& text,Encoding encoding) { set(text,encoding); }
73
74 String& operator = (const String& str);
75
76 void set(const std::string& str);
77
80 void set(const wchar_t* text);
81
84 void set(const std::string& text,Encoding encoding);
85
87 std::string createUTF8EncodedString() const;
88
89 protected:
90
91};
92
93}
94
95
96#endif
The osgText library is a NodeKit that extends the core scene graph to support high quality text.
VectorUInt(unsigned int *beg, unsigned int *end)
Definition String:35
VectorUInt()
Definition String:33
VectorUInt(const VectorUInt &copy)
Definition String:34
VectorUInt(unsigned int n)
Definition String:36
std::string createUTF8EncodedString() const
returns a UTF8 encoded version of this osgText::String.
String(const std::string &text, Encoding encoding)
Definition String:72
String(const String &str)
void set(const std::string &text, Encoding encoding)
Set the text using a Unicode encoded std::string, which is converted to an internal TextString.
VectorUInt vector_type
Definition String:47
String(const std::string &str)
Definition String:70
void set(const wchar_t *text)
Set the text using a wchar_t string, which is converted to an internal TextString.
String()
Definition String:68
String(const wchar_t *text)
Definition String:71
void set(const std::string &str)
Encoding
Types of string encodings supported.
Definition String:53
@ ENCODING_UTF32
16-bit little-endian
Definition String:60
@ ENCODING_ASCII
not using Unicode
Definition String:55
@ ENCODING_UTF16_BE
16-bit signature
Definition String:58
@ ENCODING_UTF16_LE
16-bit big-endian
Definition String:59
@ ENCODING_CURRENT_CODE_PAGE
detect encoding from signature
Definition String:64
@ ENCODING_UTF8
unsigned char ASCII
Definition String:56
@ ENCODING_UTF16
8-bit unicode transformation format
Definition String:57
@ ENCODING_UTF32_LE
32-bit big-endian
Definition String:62
@ ENCODING_UNDEFINED
Definition String:54
@ ENCODING_UTF32_BE
32-bit signature
Definition String:61
@ ENCODING_SIGNATURE
32-bit little-endian
Definition String:63
#define OSGTEXT_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.