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

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