VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwKeyValueList.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include "vrfutil/vrfutilDefines.h"
14 #include "vrfutil/rwStringList.h"
15 #include <map>
16 #include <vlutil/vlString.h>
17 
22 {
23 private:
24 public:
27 
29  DtRwKeyValueList(const DtString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
30  DtRwKeyValueList(const DtSymbolString& name, DtReaderWriterRegistry* const parentRegistry = NULL);
31 
33  virtual ~DtRwKeyValueList();
34 
36  DtRwKeyValueList(const DtRwKeyValueList& orig, DtReaderWriterRegistry* const parentRegistry = NULL);
37 
40 
43  virtual void add(const DtString& key, const DtString& value);
45  virtual void remove(const DtString& key);
47  virtual void clear();
48 
50  virtual bool contains(const DtString& key) const;
53  virtual DtString find(const DtString& key) const;
54 
58  virtual std::map<DtString, DtString> convertToMap() const;
59 
63  virtual void setFromMap(const std::map<DtString, DtString> sourceMap);
64 
66  static const char* theXmlType();
67 
68  virtual const char* xmlType() const
69  {
70  return theXmlType();
71  }
72  virtual const char* readerWriterType() const;
73 
74  virtual void populateListByType(
75  boost::function<void (DtReaderWriter*)> addFunction,
76  DtEnvironmentSP env, DtEnvValueSP node, const DtString& bindingType,
77  const DtReaderWriter::SearchPaths& searchPaths, const DtVariableBindingsList& bindings);
78 
81  virtual bool isUserEditable() const;
82 
83 protected:
84 
90 };
91 
92 namespace DtBufferSerialize
93 {
94  DT_DLL_vrfutil char *encode(const DtRwKeyValueList& val, char *buffer);
95  DT_DLL_vrfutil const char *decode(DtRwKeyValueList& val, const char *buffer) ;
96  DT_DLL_vrfutil int getSize(const DtRwKeyValueList& val);
97 
98 }
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
Class which holds a list of string key and string value pairs. This class is a DtReaderWriter, and also has associated DtBufferSerialize methods available.
Definition: rwKeyValueList.h:21
Definition: symbolString.h:20
virtual bool contains(const DtString &s) const
Returns true if the given string exists in the list.
DT_DLL_readerWriter DtBoost::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
Definition: readerWriter.h:85
Definition: readerWriterRegistry.h:39
bool myIsUserEditable
Attribute which indicates that a user can add their own items to this list. This attribute is only us...
Definition: rwKeyValueList.h:89
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
static const char * theXmlType()
The type that is used when archiving to an XML stream.
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
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...
virtual const char * xmlType() const
Routines to archive/dearchive from an XML Environment.
Definition: rwKeyValueList.h:68
virtual DtRwString * add(const DtString &)
Adds a new entry and returns the new string.
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
Definition: rwStringList.h:20
DtRwStringList & operator=(const DtRwStringList &orig)
assignment operator
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
virtual void populateListByType(boost::function< void(DtReaderWriter *)> addFunction, DtEnvironmentSP env, DtEnvValueSP node, const DtString &bindingType, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &bindings)

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)