/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
App/include/v8xml/WebParser.h
39 строк
2 KB
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
#pragma once #include "Reflection/Type.h" class XmlElement; namespace RBX { class WebParser { private: static boost::mutex JSONmutex; public: typedef enum { FailOnNonJSON, SkipNonJSON } NonJSONBehavior; static bool parseWebGenericResponse(std::istream& stream, RBX::Reflection::Variant& result); static bool parseWebGenericResponse(const XmlElement* root, RBX::Reflection::Variant& result); static bool parseWebListResponse(std::istream& stream, RBX::Reflection::ValueArray& result); static bool legacyParseWebJSONResponse(std::stringstream& rawWebResponse, shared_ptr<const Reflection::ValueTable>& valueTable); static bool ptreeParseWebJSONResponse(std::stringstream& rawWebResponse, shared_ptr<const Reflection::ValueTable>& valueTable); static bool parseJSONTable(const std::string& rawWebResponse, shared_ptr<const Reflection::ValueTable>& valueTable); static bool parseJSONArray(const std::string& rawWebResponse, shared_ptr<const Reflection::ValueArray>& valueArray); static bool parseJSONObject(const std::string& rawWebResponse, Reflection::Variant& result); static bool writeJSON(const Reflection::Variant& value, std::string& result, NonJSONBehavior skip = SkipNonJSON); protected: static bool loadTable(const XmlElement* tableElement, RBX::Reflection::ValueMap& result); static bool loadList(const XmlElement* listElement, RBX::Reflection::ValueArray& result); static bool loadEntry(const XmlElement* entryElement, std::string& key, RBX::Reflection::Variant& value); static bool loadValue(const XmlElement* valueElement, RBX::Reflection::Variant& value); }; }