public string GetString(string Key, string Default = "") { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { return(pLineValue.GetValue().ToString()); } } return(Default); }
public float GetFloat(string Key, float Default = 0.0f) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { return(pLineValue.GetValue().ToFloat()); } } return(Default); }
public int GetInt(string Key, int Default = 0) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { return(pLineValue.GetValue().ToInteger()); } } return(Default); }
public bool GetBool(string Key, bool Default = false) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { return(pLineValue.GetValue().ToBool()); } } return(Default); }
public bool bGetString(string Key, out string Out, string Default = "") { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { Out = pLineValue.GetValue().ToString(); return(true); } } Out = Default; return(false); }
public bool bGetFloat(string Key, out float Out, float Default = 0.0f) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { Out = pLineValue.GetValue().ToFloat(); return(true); } } Out = Default; return(false); }
public bool bGetInt(string Key, out int Out, int Default = 0) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { Out = pLineValue.GetValue().ToInteger(); return(true); } } Out = Default; return(false); }
public bool bGetBool(string Key, out bool Out, bool Default = false) { cLineValue pLineValue = null; if ((pLineValue = GetLineValue(Key)) != null) { if (pLineValue.Type() == ( byte )LineValueType.SINGLE) { Out = pLineValue.GetValue().ToBool(); return(true); } } Out = Default; return(false); }
// Return the type of a value assigned to a key, or -1 public int KeyType(string Key) { if (vSection.Count < 1) { return(-1); } cLineValue pLineValue = null; cValue Value = null; if ((pLineValue = GetLineValue(Key)) != null) { int iType = pLineValue.Type(); switch (iType) { case ( byte )LineValueType.SINGLE: { if ((Value = pLineValue.GetValue()) != null) { return(Value.Type()); } Debug.LogError("cSection::KeyType:WARNING! In section " + sName + " a key has no value but designed as SINGLE !!!"); break; } case ( byte )LineValueType.MULTI: { if ((pLineValue.GetMultiValue() != null)) { return(iType); } Debug.LogError("cSection::KeyType:WARNING! In section " + sName + " a key has no value but designed as MULTI !!!"); break; } } } return(-1); }