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.
The following sample illustrates how to use this class:
// encode u8 bin[] = {23, 53, 0, 12, 43, 32, 98, 127}; String encoded = Base64::encode(bin, sizeof(bin)); // decode SimpleArray<u8> decoded; Base64::decode(decoded, encoded);
| 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:
class SerializableIntContainer : public Serializable { public: ... static AutoPtr<Serializable> deserialize( Stream *inStream, size_t inLevel, Endian inEndian) { uint32_t n = read<uint32_t>(inStream, inEndian); SerializableIntContainer *pInt = new SerializableIntContainer(n); } ... private: uint32_t m_value; // This constructor should not be called directly and you // should call deserialize method. SerializableIntContainer(uint32_t n) : m_value(n) { } };
| 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 UChar1, which stores UTF-16 character.
| typedef UCharDefs<sizeof(wchar_t)>::UChar4 Celartem::UChar4 |
The definition of UChar1, 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.
| errInternalError |
General Internal Error. |
| errUnknown |
Errors that is not known to the system. |
| errSuccess |
Success. |
| errOutOfMemory |
Out of memory. |
| errBadAccess |
The access is not permitted in the current config. |
| errAccessDenied |
The access is denied (by permission). |
| errNotPermitted |
The operation is not permitted. |
| errAuthFailed |
Authentication failed. |
| errAuthRequired |
Authentication required. |
| errInvalidParam |
One of the parameter passed to the function is invalid. |
| errDivByZero |
Division by 0. |
| errInvalidState |
The internal status of the object is invalid. |
| errAlreadyExists |
The resource name has been already in use. |
| errNotAvailable |
The resource specified is not available now. |
| errNotFound |
The resource by that name (Id) is not found. |
| errEOF |
The pointer of the stream/storage exceeds the EOF. |
| errInitializationFailed |
Initialization failed. |
| errOpenFailed |
Some errors are occurred during opening the resource. |
| errReadFailed |
readBytes failed. |
| errWriteFailed |
writeBytes failed. |
| errSetPosFailed |
setPos failed. |
| errBufferOverFlow |
Buffer overflow, usually caused by passing small buffer. |
| errDataBroken |
The data is broken or unsupported structure. |
| errStringTooLong |
The string passed is too long. |
| errTypeMismatch |
Object type mismatch. |
| errChecksumError |
Checksum validation failed. |
| errProcessCanceled |
Process is canceled. |
| errStorageIsProtected |
The storage is PFZ. |
| errOperationFailed |
The requested operation is not completed. |
| errNotSupported |
The operation/object requested is not supported. |
| errNotImplemented |
The function called is not implemented. |
| errAssertionFailed |
For debugging purpose; assertion failed. |
| errSecurityValidation |
The operation violates the current security settings. |
| errLicenseViolation |
The operation is not permitted by license. |
| errCartridgeNotEnough |
Not enough cartridge to process your request. |
| errTooManyCartridges |
Too many cartridges installed on the system. |
| errTimeStampError |
Time stamp is not valid. |
| errTrialConfiction |
There's already a trial cartridge. |
| errLicenseExpired |
The license is expired. |
| errMachineIdMismatch |
The machine ID is different. |
| errNullPointer |
Null Pointer Exception. |
| errDataTooLarge |
Data too large. |
| errSemInitFailed |
Initialization of a Semaphore failed. |
| errMutexInitFailed |
Initialization of a Mutex failed. |
| errEventInitFailed |
Initialization of an Event failed. |
| errGateInitFailed |
Initialization of a Gate failed. |
| errLockFailed |
Lock failed. |
| errUnlockFailed |
Unlock failed. |
| errSignalFailed |
Sending signal failed. |
| errWaitFaild |
Waiting the synchronization objects failed. |
| errBeginThreadFailed |
The thread could be started. |
| errAlreadyRunning |
The thread is already running. |
| errNotRunning |
The thread is not running. |
This enumeration defines NullString.
| enum Celartem::ProxyType |
Proxy Types
This enumeration is used with the method HttpManager::setProxy.
RegEx option flags
This enumeration is to define the serialization policy of data.
DataArray uses this policy when it stores the data entries into the storage.
| 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 _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 if(_CEL_DEBUG_) block like as the following one:
if(_CEL_DEBUG_) { cel_dbgPrintf( "The result is %u\n", eval(fomula)); }
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. |
| 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.
| 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::DjVu::Link::setLink().
| 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:
uint32_t n = read<uint32_t>(inStream, endianBig);
| 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(), 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 | ( | 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:
write<uint32_t>(inStream, 32, endianBig);
| 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::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. |
const size_t Celartem::notFound = (size_t)SSIZE_MIN [static] |
const size_t Celartem::STR_AUTOSIZE = (size_t)SSIZE_MIN [static] |
Instructs the method to check the length.