VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
symbolString.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: symStr.h,v $ $Revision: 193772 $ $State: Exp $
7 *********************************************************************/
8 #ifndef symbolString_H_
9 #define symbolString_H_
10 
12 #include <vlutil/vlString.h>
14 
15 //
16 // This class allows one to collect and compare strings using an index
17 // number instead of having to do string compares. It is not virtual
18 // and is effectively 4 bytes meaning you can pass these by value as easily
19 // as passing a pointer
21 {
22 public:
23  // default constructor
25 
26  // additional constructors
27 // DtSymbolString(const char* str);
28  DtSymbolString(const DtString& str);
29  DtSymbolString(unsigned int i);
30 
31  // destructor
32  ~DtSymbolString();
33 
34  // copy constructor
35  DtSymbolString(const DtSymbolString& orig);
36 
37  // assignment operators
38  DtSymbolString& operator=(const DtString& orig);
39  DtSymbolString& operator=(const char* orig);
40 
41  // cast operator
42  // \deprecated This function is deprecated as of VRF 3.9, and should *not* be used.
43  operator const char*() const;
44 
45  // @return The string, in char form, associated with the symbol.
46  const char* c_str() const;
47 
48  // @return The string, in char form, associated with the symbol.
49  // \deprecated This function is deprecated as of VRF 3.9, and should *not* be used.
50  const char* string() const;
51 
52  const unsigned int symbol() const { return mySymbol; };
53 
54  // clone operator
55  DtSymbolString* clone();
56 
57  // comparison operators
58  bool operator==(const DtString& str) const; // string compare
59  bool operator!=(const DtString& str) const;
60 
61  bool operator==(const char* str) const; // string compare
62  bool operator!=(const char* str) const;
63 
64  bool operator==(const DtSymbolString& str) const; // int compare
65  bool operator!=(const DtSymbolString& str) const;
66 
67  // @note This is necessary because, unlike .Net, VC 6.0 can't auto-generate
68  // the operator when an instance of these is placed into a std::map.
69  bool operator<(const DtSymbolString& str) const;
70 
71 protected:
72 
73  unsigned int mySymbol;
74 };
75 
76 
77 #endif

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)