yast2-core
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
YCPByteblockRep Class Reference

YCPValueRep representing a block of bytes. More...

#include <YCPByteblock.h>

Inheritance diagram for YCPByteblockRep:
YCPValueRep YCPElementRep

Public Member Functions

const unsigned char * value () const
 
long size () const
 
string toString () const
 
std::ostream & toStream (std::ostream &str) const
 
std::ostream & toXml (std::ostream &str, int indent) const
 
YCPOrder compare (const YCPByteblock &s) const
 
YCPValueType valuetype () const
 
- Public Member Functions inherited from YCPValueRep
const char * valuetype_str () const
 
bool isVoid () const
 
bool isBoolean () const
 
bool isInteger () const
 
bool isFloat () const
 
bool isString () const
 
bool isByteblock () const
 
bool isPath () const
 
bool isSymbol () const
 
bool isList () const
 
bool isTerm () const
 
bool isMap () const
 
bool isCode () const
 
bool isBreak () const
 
bool isReturn () const
 
bool isEntry () const
 
bool isReference () const
 
bool isExternal () const
 
YCPVoid asVoid () const
 
YCPBoolean asBoolean () const
 
YCPInteger asInteger () const
 
YCPFloat asFloat () const
 
YCPString asString () const
 
YCPByteblock asByteblock () const
 
YCPPath asPath () const
 
YCPSymbol asSymbol () const
 
YCPList asList () const
 
YCPTerm asTerm () const
 
YCPMap asMap () const
 
YCPCode asCode () const
 
YCPEntry asEntry () const
 
YCPReference asReference () const
 
YCPExternal asExternal () const
 
bool equal (const YCPValue &) const
 
YCPOrder compare (const YCPValue &v, bool rl=false) const
 
- Public Member Functions inherited from YCPElementRep
YCPValue asValue () const
 
virtual const YCPElementRepshallowCopy () const
 

Protected Member Functions

 YCPByteblockRep (const unsigned char *bytes, long len)
 
 YCPByteblockRep (bytecodeistream &str, long len)
 
 ~YCPByteblockRep ()
 
- Protected Member Functions inherited from YCPElementRep
 YCPElementRep ()
 
virtual ~YCPElementRep ()
 

Private Attributes

const unsigned char * bytes
 
long len
 

Friends

class YCPByteblock
 

Detailed Description

YCPValueRep representing a block of bytes.

Constructor & Destructor Documentation

YCPByteblockRep::YCPByteblockRep ( const unsigned char *  bytes,
long  len 
)
protected

Creates a new YCPByteblockRep object.

Parameters
bytespointer to a buffer containing the bytes. I'll make me a copy of this, please free the memory yourself, if you need to.
lengthlength of the byte block.

References bytes, and len.

YCPByteblockRep::YCPByteblockRep ( bytecodeistream str,
long  len 
)
protected

Creates a new YCPByteblockRep object from a stream. See YCPByteblock (bytecodeistream &) implementation.

References bytes, and len.

YCPByteblockRep::~YCPByteblockRep ( )
protected

Cleans up

References bytes.

Member Function Documentation

YCPOrder YCPByteblockRep::compare ( const YCPByteblock s) const

Compares two bytes blocks.

References bytes, len, YO_EQUAL, YO_GREATER, and YO_LESS.

long YCPByteblockRep::size ( ) const

Returns the number of bytes in the block.

References len.

std::ostream & YCPByteblockRep::toStream ( std::ostream &  str) const
virtual

Output value as bytecode to stream

Implements YCPElementRep.

References bytes, len, and Bytecode::writeBytep().

string YCPByteblockRep::toString ( void  ) const
virtual

Returns a string representation of this objects value. Byteblock values are represented in YCP #(byteblockstring), where byteblockstring is some yet to be defined but typical byteblock and date representation.

Implements YCPElementRep.

References bytes, len, and tohex().

std::ostream & YCPByteblockRep::toXml ( std::ostream &  str,
int  indent 
) const
virtual

Implements YCPValueRep.

References bytes, len, and Xmlcode::writeBytep().

const unsigned char * YCPByteblockRep::value ( ) const

Returns the bytes of the block.

References bytes.

YCPValueType YCPByteblockRep::valuetype ( ) const
virtual

Returns YT_BYTEBLOCK. See YCPValueRep::type.

Implements YCPValueRep.

References YT_BYTEBLOCK.

Friends And Related Function Documentation

friend class YCPByteblock
friend

Member Data Documentation

const unsigned char* YCPByteblockRep::bytes
private
long YCPByteblockRep::len
private

Length of the byte block

Referenced by compare(), fromStream(), size(), toStream(), toString(), toXml(), and YCPByteblockRep().


The documentation for this class was generated from the following files:

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