• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

akregator

c4_Bytes Class Reference

#include <mk4.h>

List of all members.


Detailed Description

Generic data buffer, with optional automatic clean up.

These objects are used to pass around untyped data without concern about clean-up. They know whether the bytes need to be de-allocated when these objects go out of scope. Small amounts of data are stored in the object.

Objects of this class are used a lot within Metakit to manipulate its own data items generically. The c4_BytesProp class allows storing binary data explicitly in a file. If such data files must be portable, then the application itself must define a generic format to deal with byte order.

How to store an object in binary form in a row (this is not portable):

    struct MyStruct { ... };
    MyStruct something;
  
    c4_BytesProp pData ("Data");
    c4_Row row;
  
    pData (row) = c4_Bytes (&something, sizeof something);

Definition at line 497 of file mk4.h.


Public Member Functions

 c4_Bytes (const c4_Bytes &)
 c4_Bytes (const void *, int, bool)
 c4_Bytes (const void *, int)
 c4_Bytes ()
const t4_byte * Contents () const
c4_Bytes & operator= (const c4_Bytes &)
t4_byte * SetBuffer (int)
t4_byte * SetBufferClear (int)
int Size () const
void Swap (c4_Bytes &)
 ~c4_Bytes ()

Friends

bool operator!= (const c4_Bytes &, const c4_Bytes &)
bool operator== (const c4_Bytes &, const c4_Bytes &)

Constructor & Destructor Documentation

c4_Bytes::c4_Bytes (  ) 

c4_Bytes::c4_Bytes ( const void *  ,
int   
)

c4_Bytes::c4_Bytes ( const void *  buf_,
int  len_,
bool  copy_ 
)

Construct an object with contents, optionally as a copy.

Definition at line 50 of file table.cpp.

c4_Bytes::c4_Bytes ( const c4_Bytes &  src_  ) 

Copy constructor.

Definition at line 58 of file table.cpp.

c4_Bytes::~c4_Bytes (  ) 


Member Function Documentation

const t4_byte* c4_Bytes::Contents (  )  const

c4_Bytes & c4_Bytes::operator= ( const c4_Bytes &  src_  ) 

Assignment, this may make a private copy of contents.

Definition at line 65 of file table.cpp.

t4_byte * c4_Bytes::SetBuffer ( int  length_  ) 

Define contents as a freshly allocated buffer of given size.

Definition at line 111 of file table.cpp.

t4_byte * c4_Bytes::SetBufferClear ( int  length_  ) 

Allocate a buffer and fills its contents with zero bytes.

Definition at line 128 of file table.cpp.

int c4_Bytes::Size (  )  const

void c4_Bytes::Swap ( c4_Bytes &  bytes_  ) 

Swap the contents and ownership of two byte objects.

Definition at line 81 of file table.cpp.


Friends And Related Function Documentation

bool operator!= ( const c4_Bytes &  ,
const c4_Bytes &   
) [friend]

bool operator== ( const c4_Bytes &  a_,
const c4_Bytes &  b_ 
) [friend]

Return true if the contents of both objects are equal.

Definition at line 143 of file table.cpp.


Member Data Documentation

double c4_Bytes::_aligner

Definition at line 501 of file mk4.h.

t4_byte c4_Bytes::_buffer[16]

Definition at line 500 of file mk4.h.


The documentation for this class was generated from the following files:
  • mk4.h
  • table.cpp

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal