Namespaces | |
DjVu | |
FileUtils | |
License | |
Typedefs | |
typedef Base64T< Base64Traits_A > | Base64 |
typedef Base64T < UrlSafeBase64Traits > | UrlSafeBase64 |
typedef u8 | guid_t [16] |
typedef AdvCachedStorage | HttpStorage |
typedef Rational< uint32_t > | TIFF_RATIONAL |
typedef Rational< int32_t > | TIFF_SRATIONAL |
typedef ReaderWriterLockLockerTempl < true > | WriterLock |
typedef ReaderWriterLockLockerTempl < false > | ReaderLock |
typedef AutoPtr< Serializable >(* | DeserializeFunc )(Stream *inStream, size_t inLevel, Endian inEndian) |
typedef Range< uint64_t > | StorageRange |
typedef void(* | DuplicateStreamCallback )(void *inContext, size_t inBytesCopied, size_t inMaximumBytesToCopy) |
typedef int8_t | i8 |
8-byte value (signed). More... | |
typedef int16_t | i16 |
16-bit value (signed). More... | |
typedef int32_t | i32 |
32-bit value (signed). More... | |
typedef int64_t | i64 |
64-bit value (signed). More... | |
typedef uint8_t | u8 |
8-bit value (unsigned). More... | |
typedef uint16_t | u16 |
16-bit value (unsigned). More... | |
typedef uint32_t | u32 |
32-bit value (unsigned). More... | |
typedef uint64_t | u64 |
64-bit value (unsigned). More... | |
typedef UCharDefs< sizeof(wchar_t)> ::UChar1 | UChar1 |
The definition of UChar1, which stores UTF-8 character. More... | |
typedef UCharDefs< sizeof(wchar_t)> ::UChar2 | UChar2 |
The definition of UChar2, which stores UTF-16 character. More... | |
typedef UCharDefs< sizeof(wchar_t)> ::UChar4 | UChar4 |
The definition of UChar4, which stores UTF-32 character. More... | |
Functions | |
template<class T > | |
T | swap (const T &n) |
template<class T > | |
T | toBig (const T &num) |
template<class T > | |
T | toLittle (const T &num) |
template<class T > | |
T | fromBig (const T &num) |
template<class T > | |
T | fromLittle (const T &num) |
template<class T > | |
void | write (void *CEL_RESTRICT buffer, T t, Endian endian) |
template<class T > | |
void | writeArray (void *CEL_RESTRICT buffer, T *CEL_RESTRICT array, size_t count, Endian endian) |
template<class T > | |
T | read (const void *CEL_RESTRICT buffer, Endian endian) |
template<class T > | |
void | swapBytes (const void *CEL_RESTRICT ioBuffer, size_t inBytes) |
CEL_DEFINE_DATATRAITS (Locker, byConstructor, notToBeStored) | |
template<size_t ALIGN, class Int > | |
Int | align (Int sz) |
void | cel_puts_noLog (const char *message) |
void | cel_puts (const char *message) |
void | cel_vprintf (const char *format, std::va_list ap) |
void | cel_printf (const char *format,...) |
void | cel_dbgPrintf (const char *format,...) |
std::string | cel_printf_string (const char *format,...) |
template<typename T > | |
void | write (Stream *inStream, const T &n, Endian inEndian) |
template<typename T > | |
T | read (Stream *inStream, Endian inEndian) |
String | operator+ (const utf8s &str1, const String &str2) |
String | operator+ (const char *str1, const String &str2) |
String | operator+ (const UChar2 *str1, const String &str2) |
String | operator+ (const UChar4 *str1, const String &str2) |
String | format (const char *inFormat,...) |
String | formatv (const char *format, std::va_list ap) |
String | format (const wchar_t *inFormat,...) |
String | formatv (const wchar_t *format, std::va_list ap) |
String | format_utf8 (const char *inFormat,...) |
String | formatv_utf8 (const char *inFormat, std::va_list ap) |
String | repeatString (const String &string, size_t count) |
String | stringFromUnicode (const UChar1 *string, size_t length=-1) |
String | stringFromUnicode (const UChar2 *string, size_t length=-1) |
String | stringFromUnicode (const UChar4 *string, size_t length=-1) |
String | repeatChar (UChar4 chr, size_t count) |
String | chr (UChar4 chr) |
Variables | |
static const size_t | notFound = (size_t)SSIZE_MIN |
Indicates "Not Found". More... | |
static const size_t | STR_AUTOSIZE = (size_t)SSIZE_MIN |
Instructs the method to check the length. More... | |
Celartem is the primary namespace for Celartem Base Library. All the functions, classes, and other definitions are in this namespace.
typedef Base64T<Base64Traits_A> Celartem::Base64 |
Base64 encode/decode routines.\n The following sample illustrates how to use this class:
typedef AutoPtr<Serializable>(* Celartem::DeserializeFunc)(Stream *inStream, size_t inLevel, Endian inEndian) |
This is the factory definition of Serializable objects.
All classes that inherit Serializable class should implement a function named deserialize to register with REGISTER_SERIALIZABLECLASS or REGISTER_SERIALIZABLECLASS2 macro.
This function (actually, static member) reads data from the specified storage, constructs a new instance and return a pointer to it.
For example, a Serializable derivative class that stores uint32_t value can be implemented like the following code:
inStream | The stream from which the instance information is read. |
inLevel | The de-serialization level. In the top level, this value is 0. |
inEndian | The endianness used to read the data. |
typedef void(* Celartem::DuplicateStreamCallback)(void *inContext, size_t inBytesCopied, size_t inMaximumBytesToCopy) |
The definition for DuplicateStreamCallback.
inContext | The callback context. |
inBytesCopied | The number of bytes already copied. |
inMaximumBytesToCopy | The number of bytes to be copied. If the total number of bytes to be copied is unknown, this is 0. |
typedef u8 Celartem::guid_t[16] |
guid_t just preserves the GUID/UUID.
HttpStorage is an interface of Http based storages. The instances of this class created by HttpManager::createHttpStorage .
typedef int16_t Celartem::i16 |
16-bit value (signed).
typedef int32_t Celartem::i32 |
32-bit value (signed).
typedef int64_t Celartem::i64 |
64-bit value (signed).
typedef int8_t Celartem::i8 |
8-byte value (signed).
typedef ReaderWriterLockLockerTempl<false> Celartem::ReaderLock |
ReaderLock locks a ReaderWriterLock instance for read.
typedef Range<uint64_t> Celartem::StorageRange |
A specialized version of Range which can be used with 64bit storage range.
typedef Rational<uint32_t> Celartem::TIFF_RATIONAL |
This type is defined for supporting TIFF data natively. This structure is corresponding to 5=RATIONAL type of TIFF 6.0 specification.
For more information, see TIFF (TM) Revision 6.0 specification. http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf
typedef Rational<int32_t> Celartem::TIFF_SRATIONAL |
This type is defined for supporting TIFF data natively. This structure is corresponding to 10=SRATIONAL type of TIFF 6.0 specification. For more information, see TIFF (TM) Revision 6.0 specification. http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf
typedef uint16_t Celartem::u16 |
16-bit value (unsigned).
typedef uint32_t Celartem::u32 |
32-bit value (unsigned).
typedef uint64_t Celartem::u64 |
64-bit value (unsigned).
typedef uint8_t Celartem::u8 |
8-bit value (unsigned).
typedef UCharDefs<sizeof(wchar_t)>::UChar1 Celartem::UChar1 |
The definition of UChar1, which stores UTF-8 character.
typedef UCharDefs<sizeof(wchar_t)>::UChar2 Celartem::UChar2 |
The definition of UChar2, which stores UTF-16 character.
typedef UCharDefs<sizeof(wchar_t)>::UChar4 Celartem::UChar4 |
The definition of UChar4, which stores UTF-32 character.
UrlSafeBase64 encode/decode routines.
This is just another Base64 implementation which uses URL safe characters; '-' for '+' and '!' for '/'.
typedef ReaderWriterLockLockerTempl<true> Celartem::WriterLock |
WriterLock locks a ReaderWriterLock instance for write.
enum Celartem::AccessMode |
This enumeration is used with CredentialProvider::getCredential method to specify the type of the authentication target.
enum Celartem::CopyPolicy |
This enumeration is to define the copy policy of data.
SimpleArray uses this policy when it copies the data entries.
File Creation Modes.
enum Celartem::Endian |
General errors.
This enumeration defines NullString.
enum Celartem::ProxyType |
This enumeration is to define the serialization policy of data.
DataArray uses this policy when it stores the data entries into the storage.
Enumerator | |
---|---|
notToBeStored |
The data is not to be saved to the storage. |
byCopyBytes |
The data can be directly written/read by writeBytes/readBytes methods. |
bySwapCopyBytes |
The data can be written/read by writeBytes/readBytes method but byte-swapping (to deal with endianness) is required. |
byClassMethods |
The data class has implements the serialize / deserialize methods of Serializable and they should be used. |
enum Celartem::YesNo |
Int Celartem::align | ( | Int | sz | ) |
This function aligns the value to the specified alignment.
void Celartem::cel_dbgPrintf | ( | const char * | format, |
... | |||
) |
This function works only if the \ref _CEL_DEBUG_ symbol is not 0 and it is useful to output debug information. Please note that since this function is not stripped in the release version but only does nothing, the parameters passed to this function are evaluated even on the release code. And this may make your code run slowly. To reduce such problems, you had better quote the call to this function by \c if(_CEL_DEBUG_) block like as the following one:
This function works much like as \c std::printf function except it also outputs the strings to debugger view. This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales. \param format Format specification. \param ... Optional parameters. \sa _CEL_DEBUG_
Celartem::CEL_DEFINE_DATATRAITS | ( | Locker | , |
byConstructor | , | ||
notToBeStored | |||
) |
Locker can be used with SimpleArray.
void Celartem::cel_printf | ( | const char * | format, |
... | |||
) |
This function works much like as std::printf
function except it also outputs the strings to debugger view.
This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales.
format | Format specification. |
... | Optional parameters. |
std::string Celartem::cel_printf_string | ( | const char * | format, |
... | |||
) |
This function is identical to std::sprintf except it returns std::string value. This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales.
format | Format specification. |
... | Optional parameters. |
void Celartem::cel_puts | ( | const char * | message | ) |
This function works much like as std::fputs
function except it also outputs the string to debugger view.
This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales.
If CEL_DEBUG environment variable is set to 1, this function also write the message to the log file using Debug::writeLog function.
message | Message to show. |
void Celartem::cel_puts_noLog | ( | const char * | message | ) |
This function works much like as std::fputs
function except it also outputs the string to debugger view.
This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales.
If CEL_DEBUG environment variable is set to 1, this function also write the message to the log file using Debug::writeLog function.
message | Message to show. |
void Celartem::cel_vprintf | ( | const char * | format, |
std::va_list | ap | ||
) |
This function works much like as std::vprintf
function except it also outputs the string to debugger view.
This function is a portable version of sprintf and it does not depend on platform specific implementation. It is not affected by any locales.
format | Format specification. |
ap | Pointer to list of parameters. |
String Celartem::chr | ( | UChar4 | chr | ) |
This function converts the specified UCS-4 character into a string.
chr | UCS-4 character code. |
Referenced by Celartem::Converter< CharSrc, CharDest, SrcTraits, DestTraits >::bufferSize(), and Celartem::Converter< CharSrc, CharDest, SrcTraits, DestTraits >::convert().
String Celartem::format | ( | const char * | inFormat, |
... | |||
) |
This function formats a string; the result is identical to sprintf. This method may be affected by the current locale and can be used with platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
String Celartem::format | ( | const wchar_t * | inFormat, |
... | |||
) |
This function formats a string; the result is identical to swprintf. This method may be affected by the current locale and can be used with platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
String Celartem::format_utf8 | ( | const char * | inFormat, |
... | |||
) |
This function is UTF-8 version of format function. It formats the string. This function is not affected by the current locale and it does not accept platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
Referenced by Celartem::DataStore::get(), and Celartem::DjVu::Link::setLink().
String Celartem::formatv | ( | const char * | format, |
std::va_list | ap | ||
) |
This function formats a string; the result is identical to vsprintf. This method may be affected by the current locale and can be used with platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
String Celartem::formatv | ( | const wchar_t * | format, |
std::va_list | ap | ||
) |
This function formats a string; the result is identical to vswprintf. This method may be affected by the current locale and can be used with platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
String Celartem::formatv_utf8 | ( | const char * | inFormat, |
std::va_list | ap | ||
) |
This function is UTF-8 version of formatv function. It formats the string. This function is not affected by the current locale and it does not accept platform specific printf extensions.
inFormat | String that specifies the format of parameters. |
T Celartem::fromBig | ( | const T & | num | ) |
Converts the input value that is stored in Big-Endian into the native endian. (BIG -> HOST)
num | A value that is stored in Big-Endian. |
T Celartem::fromLittle | ( | const T & | num | ) |
Converts the input value that is stored in Little-Endian into the native endian. (LITTLE -> HOST)
num | A value that is stored in Little-Endian. |
String Celartem::operator+ | ( | const utf8s & | str1, |
const String & | str2 | ||
) |
This function concatenates two strings into a string.
str1 | |
str2 | Strings to be combined. |
String Celartem::operator+ | ( | const char * | str1, |
const String & | str2 | ||
) |
This function concatenates two strings into a string.
str1 | |
str2 | Strings to be combined. |
String Celartem::operator+ | ( | const UChar2 * | str1, |
const String & | str2 | ||
) |
This function concatenates two strings into a string.
str1 | |
str2 | Strings to be combined. |
String Celartem::operator+ | ( | const UChar4 * | str1, |
const String & | str2 | ||
) |
This function concatenates two strings into a string.
str1 | |
str2 | Strings to be combined. |
T Celartem::read | ( | const void *CEL_RESTRICT | buffer, |
Endian | endian | ||
) |
Reads a value from the buffer in the specified endian.
buffer | Pointer to the buffer to read from. |
endian | Endian in which the value is read. |
T Celartem::read | ( | Stream * | inStream, |
Endian | inEndian | ||
) |
This template function reads a value from the specified storage using DataTraits<T>::storagePolicy information.
inStream | This parameter specifies the stream to read from. |
inEndian | endian used to read the value, it must be one of the following values:
|
The following is a sample use of this function:
String Celartem::repeatChar | ( | UChar4 | chr, |
size_t | count | ||
) |
This function repeats the character and returns a new string.
chr | UCS-4 character code to be repeated. |
count | Repeat count. |
String Celartem::repeatString | ( | const String & | string, |
size_t | count | ||
) |
This function repeats the string and returns a new string.
string | String to be repeated. |
count | Repeat count. |
String Celartem::stringFromUnicode | ( | const UChar1 * | string, |
size_t | length = -1 |
||
) |
This function converts the specified UTF-8 string into a new string.
string | UTF-8 string to be converted. |
count | The input string length. If the value is (size_t)-1, the input string is assumed to be 0-terminated. |
String Celartem::stringFromUnicode | ( | const UChar2 * | string, |
size_t | length = -1 |
||
) |
This function converts the specified UTF-16 string into a new string.
string | UTF-16 string to be converted. |
count | The input string length. If the value is (size_t)-1, the input string is assumed to be 0-terminated. |
String Celartem::stringFromUnicode | ( | const UChar4 * | string, |
size_t | length = -1 |
||
) |
This function converts the specified UTF-32 string into a new string.
string | UTF-32 string to be converted. |
count | The input string length. If the value is (size_t)-1, the input string is assumed to be 0-terminated. |
T Celartem::swap | ( | const T & | n | ) |
General version of byte swapping.
n | A value to be swapped. |
Referenced by fromBig(), fromLittle(), Celartem::DjVu::PackedBitmap::swap(), toBig(), and toLittle().
void Celartem::swapBytes | ( | const void *CEL_RESTRICT | ioBuffer, |
size_t | inBytes | ||
) |
This function does endian-swap on the specified array.
ioBuffer | Pointer to the buffer to do endian-swap. |
inBytes | Bytes to be processed. (Not the number of entries) |
T Celartem::toBig | ( | const T & | num | ) |
Converts the input value into the Big-Endian. (HOST -> BIG)
num | A value that is stored in the native endian. |
T Celartem::toLittle | ( | const T & | num | ) |
Converts the input value into the Little-Endian. (HOST -> LITTLE)
num | A value that is stored in the native endian. |
void Celartem::write | ( | void *CEL_RESTRICT | buffer, |
T | t, | ||
Endian | endian | ||
) |
Writes a value to the buffer in the specified endian.
buffer | Pointer to the buffer to write on. |
t | A value to write (in the native endian). |
endian | Endian in which the value is written. |
void Celartem::write | ( | Stream * | inStream, |
const T & | n, | ||
Endian | inEndian | ||
) |
This template function writes a value into the specified storage using DataTraits<T>::storagePolicy information.
inStream | This parameter specifies the stream to write on. |
n | A variable to write. |
inEndian | endian used to write the value, it must be one of the following values:
|
The following is a sample use of this function:
void Celartem::writeArray | ( | void *CEL_RESTRICT | buffer, |
T *CEL_RESTRICT | array, | ||
size_t | count, | ||
Endian | endian | ||
) |
Writes values to the buffer in the specified endian.
buffer | Pointer to the buffer to write on. |
t | Array of values to write (in the native endian). |
endian | Endian in which the value is written. |
|
static |
|
static |
Instructs the method to check the length.