yast2-core
YCPFloat.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: YCPFloat.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef YCPFloat_h
22 #define YCPFloat_h
23 
24 
25 #include "YCPValue.h"
26 
27 
38 class YCPFloatRep : public YCPValueRep
39 {
40  double v;
41 
42 protected:
43  friend class YCPFloat;
44 
49  YCPFloatRep(double v);
50 
55  YCPFloatRep(const char *r);
56 
57 public:
62  double value() const;
63 
71  YCPOrder compare(const YCPFloat &v) const;
72 
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 YCPFloat : public YCPValue
102 {
103  DEF_COMMON(Float, Value);
104 public:
105  YCPFloat(double v) : YCPValue(new YCPFloatRep(v)) {}
106  YCPFloat(const char *r) : YCPValue(new YCPFloatRep(r)) {}
108 };
109 
110 #endif // YCPFloat_h
YCPOrder compare(const YCPFloat &v) const
Definition: YCPFloat.cc:66
#define str
Definition: scanner.cc:997
double v
Definition: YCPFloat.h:40
YCPValueType valuetype() const
Definition: YCPFloat.cc:89
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
DEF_COMMON(Float, Value)
YCPValueRep representing a floating point number. The precision of the floating point number a YCPFlo...
Definition: YCPFloat.h:38
string toString() const
Definition: YCPFloat.cc:74
YCPFloat(const char *r)
Definition: YCPFloat.h:106
double value() const
Definition: YCPFloat.cc:59
YCPOrder
Definition: YCPValue.h:57
YCPFloatRep(double v)
Definition: YCPFloat.cc:30
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: YCPFloat.cc:98
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
YCPFloat(double v)
Definition: YCPFloat.h:105
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YCPFloat.cc:104
Wrapper for YCPFloatRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPFloatRep with the arrow operator. See YCPFloatRep.
Definition: YCPFloat.h:101

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