00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef YCPValue_h
00023 #define YCPValue_h
00024
00025 #define XREFDEBUG "Y2XREFDEBUG"
00026
00027 #include "YCPElement.h"
00028
00034 enum YCPValueType {
00035 YT_VOID = 0,
00036 YT_BOOLEAN = 1,
00037 YT_INTEGER = 2,
00038 YT_FLOAT = 3,
00039 YT_STRING = 4,
00040 YT_BYTEBLOCK = 5,
00041 YT_PATH = 6,
00042 YT_SYMBOL = 7,
00043 YT_LIST = 8,
00044 YT_TERM = 9,
00045 YT_MAP = 10,
00046 YT_CODE = 11,
00047 YT_RETURN = 12,
00048 YT_BREAK = 13,
00049 YT_ENTRY = 14,
00050 YT_ERROR = 15,
00051 YT_REFERENCE = 16
00052 };
00053
00054 enum YCPOrder {
00055 YO_LESS = -1,
00056 YO_EQUAL = 0,
00057 YO_GREATER = 1
00058 };
00059
00068 class YCPValueRep : public YCPElementRep
00069 {
00070 public:
00076 virtual YCPValueType valuetype() const = 0;
00077
00081 bool isVoid() const;
00082
00086 bool isBoolean() const;
00087
00091 bool isInteger() const;
00092
00096 bool isFloat() const;
00097
00101 bool isString() const;
00102
00106 bool isByteblock() const;
00107
00111 bool isPath() const;
00112
00116 bool isSymbol() const;
00117
00121 bool isList() const;
00122
00127 bool isTerm() const;
00128
00132 bool isMap() const;
00133
00137 bool isCode() const;
00138
00142 bool isBreak() const;
00143
00147 bool isReturn() const;
00148
00152 bool isEntry() const;
00153
00157 bool isReference() const;
00158
00162 YCPVoid asVoid() const;
00163
00167 YCPBoolean asBoolean() const;
00168
00172 YCPInteger asInteger() const;
00173
00177 YCPFloat asFloat() const;
00178
00182 YCPString asString() const;
00183
00187 YCPByteblock asByteblock() const;
00188
00192 YCPPath asPath() const;
00193
00197 YCPSymbol asSymbol() const;
00198
00202 YCPList asList() const;
00203
00207 YCPTerm asTerm() const;
00208
00212 YCPMap asMap() const;
00213
00217 YCPCode asCode() const;
00218
00222 YCPEntry asEntry() const;
00223
00227 YCPReference asReference() const;
00228
00233 bool equal (const YCPValue&) const;
00234
00244 YCPOrder compare(const YCPValue &v, bool rl = false) const;
00245
00246 };
00247
00248
00255 class YCPValue : public YCPElement
00256 {
00257 DEF_COMMON(Value, Element);
00258 public:
00259 };
00260
00261
00262
00263 extern YCPValue YCPError ( string message, const YCPValue &ret = YCPNull ());
00264
00265 #endif // YCPValue_h