VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwString.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vlutil/vlString.h>
14 
21 {
22 public:
24  DtRwString();
25 
27  explicit DtRwString(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
28  explicit DtRwString(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
29 
31  DtRwString(const DtString& name,
32  const char* fromChars,
33  DtReaderWriterRegistry* const parentRegistry = NULL);
34 
35  DtRwString(const DtSymbolString& name,
36  const char* fromChars,
37  DtReaderWriterRegistry* const parentRegistry = NULL);
38 
39  DtRwString(const DtString& name,
40  const DtString& fromString,
41  DtReaderWriterRegistry* const parentRegistry = NULL);
42 
43  DtRwString(const DtSymbolString& name,
44  const DtString& fromString,
45  DtReaderWriterRegistry* const parentRegistry = NULL);
46 
47  DtRwString(const DtString& name,
48  const DtRwString& fromString,
49  DtReaderWriterRegistry* const parentRegistry = NULL);
50 
51  DtRwString(const DtSymbolString& name,
52  const DtRwString& fromString,
53  DtReaderWriterRegistry* const parentRegistry = NULL);
54 
56  DtRwString(const DtRwString& orig, DtReaderWriterRegistry* const parentRegistry = NULL);
57 
59  DtRwString& operator=(const DtRwString & orig);
60  DtRwString& operator=(const char * orig);
61  DtRwString& operator=(const DtString & orig);
62  DtRwString& operator=(const DtSymbolString & orig);
63 
64  virtual ~DtRwString();
65 
66  virtual void putData(std::string& fp, int indentLevel = 0);
67  virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
68  const DtVariableBindingsList& variableBindings);
69 
73  virtual const char* readerWriterType() const;
74 
77  virtual DtString unsubstitutedString() const;
78 
81  virtual void setUnsubstitutedString(const DtString&);
82 
87  virtual bool containsVariableSubstitutions() const;
88 
90  virtual DtString prettyPrint() const;
91 
93  virtual int alignment() const;
94 
96  virtual void reset();
97 
100  virtual void putData(DtEnvironmentSP, DtEnvValueSP parent) const;
101  virtual void getData(const DtEnvironmentSP, const DtEnvValueSP value,
103  const DtVariableBindingsList& bindings = DtVariableBindingsList());
104 
106  static const char* theXmlType();
107 
108  virtual const char* xmlType() const
109  {
110  return theXmlType();
111  }
113 
114  bool operator==(const DtRwString&) const;
115  bool operator==(const DtString&) const;
116  bool operator!=(const DtString& rhs) const { return !(*this == rhs); };
117  bool operator!=(const DtRwString& rhs) const { return !(*this == rhs); };
118  bool operator==(const char*) const;
119  bool operator!=(const char* rhs) const { return !(*this == rhs); };
120 
121 protected:
122  // Overridden to manage in-text variable substitution.
123  virtual void bindLocalVariables(const DtVariableBindingsList& variableBindings);
124 
125 protected:
127 
128 };
129 
133 {
134 public:
135  DtEscapeString(const DtString& str);
136 
137  const char* c_str() { return myReturnString->c_str(); };
138 
139 protected:
140  DtString myEscapedString;
142 };
143 
145 
146 
152 
156 
bool operator==(const DtReaderWriter &) const
Equivalence operator.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
NOTE: This function is not thread-safe as it uses a static global to escape the string.
Definition: rwString.h:132
DT_DLL_readerWriter DtString DtXmlBindingCharToMtl(const DtString &str)
Can&#39;t use &#39;$&#39; for variables. so where we would use it, as in filenames with variables, it will be replaced with &#39;@&#39;.
#define DT_DLL_readerWriter
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: readerWriterDefines.h:34
Definition: symbolString.h:20
DT_DLL_readerWriter DtBoost::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
DtString myUnsubstitutedString
Definition: rwString.h:126
DT_DLL_readerWriter DtString DtRemoveQuotes(const DtString &str)
virtual DtlObjPtr getData(DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
Deriving class overrides these to get/put class specific data.
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
virtual DtString prettyPrint() const
Routine to return a human readable form of the reader/writer variable. Not all reader/writer classes ...
virtual void reset()
For those reader/writer items that support it, resets the reader/writer value to original state Defau...
virtual void bindLocalVariables(const DtVariableBindingsList &variableBindings)
Checks to see if this RW object is a variable reference that can be bound using the provided bindings...
const DtString * myReturnString
Definition: rwString.h:141
DT_DLL_readerWriter std::string DtConvertToXmlParsing(const DtString &s)
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
virtual int alignment() const
For those items that are sent over the network via HLA, this will give the network alignment...
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DT_DLL_readerWriter DtString DtMtlBindingCharToXml(const DtString &str)
bool operator!=(const char *rhs) const
Definition: rwString.h:119
bool operator!=(const DtRwString &rhs) const
Definition: rwString.h:117
virtual void putData(std::string &fp, int indentLevel=0)
Deriving class overrides these to get/put class specific data.
DT_DLL_readerWriter std::string DtConvertForXmlParsing(const DtString &)
Given a string, replace all characters that XML cannot read to quoted characters. ...
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwString.h:108
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
bool operator!=(const DtString &rhs) const
Definition: rwString.h:116
static const char * theXmlType()
The type that is used when archiving to an XML stream.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)