00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YCPSymbol.h 00014 00015 Author: Mathias Kettner <kettner@suse.de> 00016 Maintainer: Klaus Kaempf <kkaempf@suse.de> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 #ifndef YCPSymbol_h 00022 #define YCPSymbol_h 00023 00024 00025 #include "YCPValue.h" 00026 #include <y2util/Ustring.h> 00027 00028 00040 class YCPSymbolRep : public YCPValueRep 00041 { 00042 Ustring v; 00043 00044 protected: 00045 friend class YCPSymbol; 00046 00050 YCPSymbolRep(const char *s); 00051 00055 YCPSymbolRep(string s); 00056 00057 public: 00061 string symbol() const; 00062 00066 const char *symbol_cstr() const; 00067 00076 YCPOrder compare(const YCPSymbol &v) const; 00077 00081 string toString() const; 00082 00086 std::ostream & toStream (std::ostream & str) const; 00087 00091 YCPValueType valuetype() const; 00092 }; 00093 00100 class YCPSymbol : public YCPValue 00101 { 00102 DEF_COMMON(Symbol, Value); 00103 public: 00104 YCPSymbol(const char *s) : YCPValue(new YCPSymbolRep(s)) {} 00105 YCPSymbol(string s) : YCPValue(new YCPSymbolRep(s)) {} 00106 YCPSymbol(bytecodeistream & str); 00107 }; 00108 00109 #endif // YCPSymbol_h