Coin  4.0.10
Coin3D core library
Loading...
Searching...
No Matches
SbName.h
1#ifndef COIN_SBNAME_H
2#define COIN_SBNAME_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/SbBasic.h>
37
38class SbString;
39
41public:
42 SbName(void);
43 SbName(const char * namestring);
44 SbName(const SbString & str);
45 SbName(const SbName & name);
46 SbName & operator=(const SbName & name) = default;
47 ~SbName();
48
49 const char * getString(void) const;
50 int getLength(void) const;
51
52 int operator!(void) const;
53 friend COIN_DLL_API int operator==(const SbName & lhs, const char * rhs);
54 friend COIN_DLL_API int operator==(const char * lhs, const SbName & rhs);
55 friend COIN_DLL_API int operator==(const SbName & lhs, const SbName & rhs);
56 friend COIN_DLL_API int operator!=(const SbName & lhs, const char * rhs);
57 friend COIN_DLL_API int operator!=(const char * lhs, const SbName & rhs);
58 friend COIN_DLL_API int operator!=(const SbName & lhs, const SbName & rhs);
59
60 operator const char * (void) const;
61
62 // The following 4 functions shouldn't be in this class, they are
63 // related solely to .iv/.wrl file I/O (and so would likely be
64 // better placed in SoOutput). This is a design flaw, but we can't
65 // fix it without breaking API compatibility with the original SGI
66 // Inventor.
67 static SbBool isIdentStartChar(const char c);
68 static SbBool isIdentChar(const char c);
69 static SbBool isBaseNameStartChar(const char c);
70 static SbBool isBaseNameChar(const char c);
71
72 static const SbName & empty(void);
73
74private:
75 const char * permaaddress;
76};
77
78COIN_DLL_API int operator==(const SbName & lhs, const char * rhs);
79COIN_DLL_API int operator==(const char * lhs, const SbName & rhs);
80COIN_DLL_API int operator==(const SbName & lhs, const SbName & rhs);
81COIN_DLL_API int operator!=(const SbName & lhs, const char * rhs);
82COIN_DLL_API int operator!=(const char * lhs, const SbName & rhs);
83COIN_DLL_API int operator!=(const SbName & lhs, const SbName & rhs);
84
85#endif // !COIN_SBNAME_H
The SbList class is a template container class for lists.
Definition SbList.h:72
int getLength(void) const
Definition SbList.h:176
SbList< Type > & operator=(const SbList< Type > &l)
Definition SbList.h:101
int operator!=(const SbList< Type > &l) const
Definition SbList.h:225
SbList(const int sizehint=DEFAULTSIZE)
Definition SbList.h:80
int operator==(const SbList< Type > &l) const
Definition SbList.h:217
The SbName class stores strings by reference.
Definition SbName.h:40
The SbString class is a string class with convenience functions for string operations.
Definition SbString.h:52