yast2-core
YCPBoolean.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: YCPBoolean.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef YCPBoolean_h
22 #define YCPBoolean_h
23 
24 
25 #include "YCPValue.h"
26 
27 
34 class YCPBooleanRep : public YCPValueRep
35 {
36  bool v;
37 
38 protected:
39  friend class YCPBoolean;
40 
44  YCPBooleanRep(bool v);
45 
51  YCPBooleanRep(const char *r);
52 
53 public:
58  bool value() const;
59 
67  YCPOrder compare(const YCPBoolean &) const;
68 
73  string toString() const;
74 
78  std::ostream & toStream (std::ostream & str) const;
79  std::ostream & toXml (std::ostream & str, int indent ) const;
80 
84  YCPValueType valuetype() const;
85 };
86 
93 class YCPBoolean : public YCPValue
94 {
95  DEF_COMMON(Boolean, Value);
96 
99 
100 public:
101  YCPBoolean(bool v);
102  YCPBoolean(const char *r) : YCPValue(new YCPBooleanRep(r)) {}
104 };
105 
106 #endif // YCPBoolean_h
YCPBoolean(bool v)
Definition: YCPBoolean.cc:89
#define str
Definition: scanner.cc:997
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YCPBoolean.cc:63
bool v
Definition: YCPBoolean.h:36
YCPValueType valuetype() const
Definition: YCPBoolean.cc:70
static YCPBoolean * trueboolean
Definition: YCPBoolean.h:97
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
YCPBooleanRep(bool v)
Definition: YCPBoolean.cc:27
YCPOrder compare(const YCPBoolean &) const
Definition: YCPBoolean.cc:77
bool value() const
Definition: YCPBoolean.cc:39
YCPValueRep representing a boolean value.
Definition: YCPBoolean.h:34
DEF_COMMON(Boolean, Value)
YCPOrder
Definition: YCPValue.h:57
Abstract base class of all YCP values. Abstract base class of all YCP elements that can be used as pr...
Definition: YCPValue.h:71
std::ostream & toStream(std::ostream &str) const
Definition: YCPBoolean.cc:56
YCPBoolean(const char *r)
Definition: YCPBoolean.h:102
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
static YCPBoolean * falseboolean
Definition: YCPBoolean.h:98
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
Wrapper for YCPBooleanRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPBooleanRep with the arrow operator. See YCPBooleanRep.
Definition: YCPBoolean.h:93
string toString() const
Definition: YCPBoolean.cc:46

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