utils.h File Reference

#include "utils/types.h"

Classes

struct  EmptyDeallocator< T >
struct  char_buffer_delete
struct  PdfOpCmpRc
struct  PdfOpCmpPt

Typedefs

typedef boost::shared_ptr< char > CharBuffer

Functions

char * char_buffer_new (size_t l)
template<class T , class U >
bool isBitSet (T value, U mask)
unsigned short setNoneBitsShort ()
template<class U >
unsigned short setNthBitsShort (U mask)
template<class U >
unsigned short setNthBitsShort (U mask, U mask1)
template<class U >
unsigned short setNthBitsShort (U mask, U mask1, U mask2)
template<class U >
unsigned short setNthBitsShort (U mask, U mask1, U mask2, U mask3)
template<class U >
unsigned short setNthBitsShort (U mask, U mask1, U mask2, U mask3, U mask4)
bool nocase_compare (char c1, char c2)

Typedef Documentation

typedef boost::shared_ptr<char> CharBuffer

Special char buffer that can contain null characters.

Standard string class can also contain null characters but consider the following pitfall:

 string nul = "\0";
 char cnul = '\0';

 str = "123";
 str += nul; // "123" size: 3 
 str += cnul // "123\0" size: 4

Function Documentation

char* char_buffer_new ( size_t  l  )  [inline]
template<class T , class U >
bool isBitSet ( value,
mask 
) [inline]

Is n-th bit set.

Parameters:
value Value to be checked.
mask N-th bit.
Returns:
True if set, false otherwise.
bool nocase_compare ( char  c1,
char  c2 
) [inline]

Case insensitive comparator.

Referenced by pdfobjects::utils::xpdfObjFromString().

unsigned short setNoneBitsShort (  )  [inline]

Reset all bits.

template<class U >
unsigned short setNthBitsShort ( mask,
mask1,
mask2,
mask3,
mask4 
) [inline]

References setNthBitsShort().

template<class U >
unsigned short setNthBitsShort ( mask,
mask1,
mask2,
mask3 
) [inline]

References setNthBitsShort().

template<class U >
unsigned short setNthBitsShort ( mask,
mask1,
mask2 
) [inline]

References setNthBitsShort().

template<class U >
unsigned short setNthBitsShort ( mask,
mask1 
) [inline]

References setNthBitsShort().

template<class U >
unsigned short setNthBitsShort ( mask  )  [inline]

Set n-th set.

Parameters:
mask N-th bit.
Returns:
Value with n-th bit set.

Referenced by setNthBitsShort().