yast2-core
YCPInteger.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: YCPInteger.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef YCPInteger_h
22 #define YCPInteger_h
23 
24 
25 #include "YCPValue.h"
26 
27 
33 class YCPIntegerRep : public YCPValueRep
34 {
35  long long v;
36 
37 protected:
38  friend class YCPInteger;
39 
43  YCPIntegerRep(long long v);
44 
49  YCPIntegerRep(const char *r, bool *valid);
50 
51 public:
56  long long value() const;
57 
65  YCPOrder compare(const YCPInteger &v) const;
66 
71  string toString() const;
72 
76  std::ostream & toStream (std::ostream & str) const;
77  std::ostream & toXml (std::ostream & str, int indent ) const;
78 
82  YCPValueType valuetype() const;
83 
84 };
85 
92 class YCPInteger : public YCPValue
93 {
94  DEF_COMMON(Integer, Value);
95 public:
96  YCPInteger(long long v) : YCPValue(new YCPIntegerRep(v)) {}
97  YCPInteger(const char *r, bool *valid = NULL) : YCPValue(new YCPIntegerRep(r, valid)) {}
99 };
100 
101 #endif // YCPInteger_h
YCPValueRep representing a 64 bit signed integer.
Definition: YCPInteger.h:33
#define str
Definition: scanner.cc:997
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YCPInteger.cc:114
Wrapper for YCPIntegerRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPIntegerRep with the arrow operator. See YCPIntegerRep.
Definition: YCPInteger.h:92
long long value() const
Definition: YCPInteger.cc:65
YCPInteger(long long v)
Definition: YCPInteger.h:96
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
YCPOrder compare(const YCPInteger &v) const
Definition: YCPInteger.cc:72
string toString() const
Definition: YCPInteger.cc:80
YCPOrder
Definition: YCPValue.h:57
DEF_COMMON(Integer, Value)
long long v
Definition: YCPInteger.h:35
Abstract base class of all YCP values. Abstract base class of all YCP elements that can be used as pr...
Definition: YCPValue.h:71
YCPValueType valuetype() const
Definition: YCPInteger.cc:89
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
YCPIntegerRep(long long v)
Definition: YCPInteger.cc:29
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
YCPInteger(const char *r, bool *valid=NULL)
Definition: YCPInteger.h:97
std::ostream & toStream(std::ostream &str) const
Definition: YCPInteger.cc:97

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