Home » Developing U++ » U++ Developers corner » ValueMap
ValueMap [message #12030] |
Mon, 08 October 2007 23:32 |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Based on Bas's code, I am finally coming to introducing ValueMap to U++.
Anyway, there were some problems with his original implementation PLUS I wanted to add ValueArray conversions from/to ValueMap (simply converting the values fron key-value pair).
To this end, I had to change the interface a bit, ending with something like this:
class ValueMap {
public:
ValueMap();
ValueMap(const ValueMap& v);
~ValueMap();
ValueMap& operator=(const ValueMap& v);
operator Value() const;
ValueMap(const Value& src);
ValueMap(const Nuller&);
bool IsNullInstance() const { return data->IsNull(); }
void Clear();
void Put(const Value& key, const Value& value);
void Remove(const Value& key);
ValueArray GetKeys() const;
ValueArray GetValues() const;
operator ValueArray() const { return GetValues(); }
Value operator[](const Value& k) const;
unsigned GetHashValue() const { return data->GetHashValue(); }
void Serialize(Stream& s);
String ToString() const { return data->AsString(); }
bool operator==(const ValueMap& v) const;
bool operator!=(const ValueMap& v) const { return !operator==(v); }
}
The question is, if anybody used the original version, will this new one be OK for you?
Mirek
|
|
|
Goto Forum:
Current Time: Sat May 10 02:50:36 CEST 2025
Total time taken to generate the page: 0.02381 seconds
|