# Deserializer.hpp
This File On Github
Ask A Question
API: latest
module: oatpp-mongo
#include "oatpp-mongo/bson/mapping/Deserializer.hpp"
# Deserializer
BSON Deserializer. Deserialize oatpp DTO object from bson. See Data Transfer Object(DTO) component.
namespace oatpp { namespace mongo { namespace bson { namespace mapping {
class Deserializer {}
}}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | Deserializer | Constructor. |
void | setDeserializerMethod | Set deserializer method for type. |
oatpp::Void | deserialize | Deserialize text. |
const std::shared_ptr<Config>& | getConfig | Get deserializer config. |
# Deserializer::Deserializer
Constructor.
- @param config
Deserializer(const std::shared_ptr<Config>& config = std::make_shared<Config>())
# Deserializer::setDeserializerMethod
Set deserializer method for type.
- @param classId - oatpp::data::mapping::type::ClassId.
- @param method -
typedef oatpp::Void (*DeserializerMethod)(Deserializer*, parser::Caret, const Type* const)
.
void setDeserializerMethod(const data::mapping::type::ClassId& classId, DeserializerMethod method)
# Deserializer::deserialize
Deserialize text.
- @param caret - oatpp::parser::Caret.
- @param type - oatpp::data::mapping::type::Type
- @return -
oatpp::Void
over deserialized object.
oatpp::Void deserialize(parser::Caret& caret, const Type* const type, v_char8 bsonTypeCode)
# Deserializer::getConfig
Get deserializer config.
- @return
const std::shared_ptr<Config>& getConfig()
# Deserializer::Config
Deserializer config.
namespace oatpp { namespace mongo { namespace bson { namespace mapping {
class Deserializer {
class Config : public oatpp::base::Countable {}
};
}}}}
# Fields
Type | Name | Summary |
---|---|---|
bool | allowUnknownFields | Do not fail if unknown field is found in bson. "unknown field" is the one which is not present in DTO object class. |
std::vector<std::string> | enableInterpretations | Enable type interpretations. |
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | Config | Constructor. |
std::shared_ptr<Config> | createShared | Create shared Config. |
# Deserializer::Config::allowUnknownFields
Do not fail if unknown field is found in bson. "unknown field" is the one which is not present in DTO object class.
bool allowUnknownFields = true
# Deserializer::Config::enableInterpretations
Enable type interpretations.
std::vector<std::string> enableInterpretations =
# Deserializer::Config::Config
Constructor.
Config()
# Deserializer::Config::createShared
Create shared Config.
- @return -
std::shared_ptr
to Config.
static std::shared_ptr<Config> createShared()