mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-01 15:52:41 -06:00
Core: MapConvert::Default
git-svn-id: svn://ultimatepp.org/upp/trunk@5574 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e296c7d9ab
commit
3f166c25c8
2 changed files with 3 additions and 1 deletions
|
|
@ -493,7 +493,7 @@ GLOBAL_VAR_INIT(const ConvertString, StdConvertString);
|
|||
GLOBAL_VARP_INIT(const ConvertString, StdConvertStringNotNull, (INT_MAX, true))
|
||||
|
||||
Value MapConvert::Format(const Value& q) const {
|
||||
return map.Get(q, Null);
|
||||
return map.Get(q, default_value);
|
||||
}
|
||||
|
||||
NoConvertClass::NoConvertClass() {}
|
||||
|
|
|
|||
|
|
@ -233,10 +233,12 @@ public:
|
|||
|
||||
protected:
|
||||
VectorMap<Value, Value> map;
|
||||
Value default_value;
|
||||
|
||||
public:
|
||||
void Clear() { map.Clear(); }
|
||||
MapConvert& Add(const Value& a, const Value& b) { map.Add(a, b); return *this; }
|
||||
MapConvert& Default(const Value& v) { default_value = v; return *this; }
|
||||
|
||||
int GetCount() const { return map.GetCount(); }
|
||||
int Find(const Value& v) const { return map.Find(v); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue