yast2-core
YCPSymbol.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: YCPSymbol.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Klaus Kaempf <kkaempf@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef YCPSymbol_h
22 #define YCPSymbol_h
23 
24 
25 #include "YCPValue.h"
26 #include <y2util/Ustring.h>
27 
28 
40 class YCPSymbolRep : public YCPValueRep
41 {
43 
44 protected:
45  friend class YCPSymbol;
46 
50  YCPSymbolRep(const char *s);
51 
55  YCPSymbolRep(string s);
56 
57 public:
61  string symbol() const;
62 
66  const char *symbol_cstr() const;
67 
76  YCPOrder compare(const YCPSymbol &v) const;
77 
81  string toString() const;
82 
86  std::ostream & toStream (std::ostream & str) const;
87  std::ostream & toXml (std::ostream & str, int indent ) const;
88 
92  YCPValueType valuetype() const;
93 };
94 
101 class YCPSymbol : public YCPValue
102 {
103  DEF_COMMON(Symbol, Value);
104 public:
105  YCPSymbol(const char *s) : YCPValue(new YCPSymbolRep(s)) {}
106  YCPSymbol(string s) : YCPValue(new YCPSymbolRep(s)) {}
108 };
109 
110 #endif // YCPSymbol_h
YCP symbol. Symbols appear as components of pathes, as names of structure elements and as term names...
Definition: YCPSymbol.h:40
const char * symbol_cstr() const
Definition: YCPSymbol.cc:48
#define str
Definition: scanner.cc:1003
YCPValueType valuetype() const
Definition: YCPSymbol.cc:70
std::ostream & toStream(std::ostream &str) const
Definition: YCPSymbol.cc:80
string symbol() const
Definition: YCPSymbol.cc:41
YCPSymbol(string s)
Definition: YCPSymbol.h:106
Ustring v
Definition: YCPSymbol.h:42
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YCPSymbol.cc:86
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
friend class YCPSymbol
Definition: YCPSymbol.h:45
string toString() const
Definition: YCPSymbol.cc:63
YCPOrder compare(const YCPSymbol &v) const
Definition: YCPSymbol.cc:55
Wrapper for YCPSymbolRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPSymbolRep with the arrow operator. See YCPSymbolRep.
Definition: YCPSymbol.h:101
YCPSymbol(const char *s)
Definition: YCPSymbol.h:105
Unique strings.
Definition: Ustring.h:124
YCPOrder
Definition: YCPValue.h:57
YCPSymbolRep(const char *s)
Definition: YCPSymbol.cc:28
Abstract base class of all YCP values. Abstract base class of all YCP elements that can be used as pr...
Definition: YCPValue.h:71
#define DEF_COMMON(name, base)
Definition: YCPElement.h:83
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42

Generated on a sunny day for yast2-core by doxygen 1.8.11