Проекты‎ > ‎USDS‎ > ‎USDS Basic parser‎ > ‎

Описание API Basic Parser

Класс BasicParser

Конструкторы

BasicParser() 

Работа со словарем

void addDictionaryFromText(const char* text_dictionary, int size, usdsEncodes encode) throw(...); 
void CurrentDictionaryToText(usdsEncodes encode, std::string* text) throw(...);
void selectDictionary(int id, unsigned char major, unsigned char minor) throw(...);

Получение информации о словаре

int getDictionaryID() throw(...); unsigned char getDictionaryMajor() throw(...); unsigned char getDictionaryMinor() throw(...); 

Поиск тегов и полей в документе USDS

int getTagID(const char* name) throw(...);
int getFieldID(int tag_id, const char* name) throw(...);
UsdsBaseType* getFirstTag() throw(...);
UsdsBaseType* getFirstTag(const char* name) throw(...);
UsdsStruct* getFirstStructTag(const char* name) throw(...);

Формирование DOM-объекта

UsdsBaseType* addTag(int id) throw(...);
UsdsStruct* addStructTag(const char* name) throw(...);


Работа с бинарным документом USDS

void encode(BinaryOutput* buff, bool with_head, bool with_dictionary, bool with_body) throw(...);
void decode(const unsigned char* data, size_t data_size) throw(...);

Работа с текстовыми форматами

void getJSON(usdsEncodes encode, std::string* text) throw(...); 

Очистка парсера

void clear();
void clearBody();

Класс UsdsStruct

Информация о теге

const char* getName() throw(...);
size_t getNameSize() throw(...);
int getID() throw(...);
usdsTypes getType();
const char* getTypeName();

Навигация

UsdsBaseType* getNext() throw (...);
UsdsBaseType* getPrevious() throw (...);
UsdsBaseType* getParent() throw (...);

Инициализация полей

void setFieldValue(const char* name, int value) throw (...);
void setFieldValue(const char* name, long long value) throw (...);
void setFieldValue(const char* name, double value) throw (...);
void setFieldValue(const char* name, const char* value) throw (...);
void setFieldValue(const char* name, bool value) throw (...);

void setFieldValue(int id, int value) throw (...);
void setFieldValue(int id, long long value) throw (...);
void setFieldValue(int id, double value) throw (...);
void setFieldValue(int id, const char* value) throw (...);
void setFieldValue(int id, bool value) throw (...);

Получение значений полей

void getFieldValue(const char* name, int* value) throw (...);
void getFieldValue(const char* name, long long* value) throw (...);
void getFieldValue(const char* name, double* value) throw (...);
void getFieldValue(const char* name, const char** value) throw (...);
void getFieldValue(const char* name, bool* value) throw (...);

void getFieldValue(int id, int* value) throw (...);
void getFieldValue(int id, long long* value) throw (...);
void getFieldValue(int id, double* value) throw (...);
void getFieldValue(int id, const char** value) throw (...);
void getFieldValue(int id, bool* value) throw (...)


Работа с полями-массивами

UsdsArray* getArrayField(const char* name) throw (...);
UsdsArray* getArrayField(int id) throw (...);



Класс UsdsArray

Определение типа элементов массива

size_t getElementNumber() throw(...);
usdsTypes getElementType() throw(...);

Работа с элементами массива типа "Тэг"

UsdsBaseType* addTagElement() throw(...);
UsdsBaseType* getTagElement(size_t number) throw(...);



2015.11.02 Андрей Абрамов
CC BY 4.0

Comments

Не удалось найти URL спецификации гаджета