yast2-core
YCPByteblock.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: YCPByteblock.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 #ifndef YCPByteblock_h
22 #define YCPByteblock_h
23 
24 
25 #include "YCPValue.h"
26 
27 
32 {
36  const unsigned char *bytes;
37 
41  long len;
42 
43 protected:
44  friend class YCPByteblock;
45 
52  YCPByteblockRep(const unsigned char *bytes, long len);
53 
59 
64 
65 public:
69  const unsigned char *value() const;
70 
74  long size() const;
75 
82  string toString() const;
83 
87  std::ostream & toStream (std::ostream & str) const;
88  std::ostream & toXml (std::ostream & str, int indent ) const;
89 
93  YCPOrder compare(const YCPByteblock& s) const;
94 
98  YCPValueType valuetype() const;
99 };
100 
101 
108 class YCPByteblock : public YCPValue
109 {
110  DEF_COMMON(Byteblock, Value);
111 public:
112  YCPByteblock(const unsigned char *r, long l) : YCPValue(new YCPByteblockRep(r, l)) {}
114 };
115 
116 
117 #endif // YCPByteblock_h
YCPByteblockRep(const unsigned char *bytes, long len)
Definition: YCPByteblock.cc:30
#define str
Definition: scanner.cc:997
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YCPByteblock.cc:141
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
Wrapper for YCPByteblockRep This class realizes an automatic memory management via YCPElement...
Definition: YCPByteblock.h:108
~YCPByteblockRep()
Definition: YCPByteblock.cc:46
YCPOrder compare(const YCPByteblock &s) const
Definition: YCPByteblock.cc:68
const unsigned char * value() const
Definition: YCPByteblock.cc:53
std::ostream & toStream(std::ostream &str) const
Definition: YCPByteblock.cc:135
string toString() const
Definition: YCPByteblock.cc:93
YCPValueRep representing a block of bytes.
Definition: YCPByteblock.h:31
const unsigned char * bytes
Definition: YCPByteblock.h:36
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
YCPValueType valuetype() const
Definition: YCPByteblock.cc:124
YCPByteblock(const unsigned char *r, long l)
Definition: YCPByteblock.h:112
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
long len
Definition: YCPByteblock.h:41
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
DEF_COMMON(Byteblock, Value)
long size() const
Definition: YCPByteblock.cc:60

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