oatpp-boringssl
repository here - https://github.com/oatpp/oatpp-boringssl please feel free to fork it.OpenSSL
Hey, thanks for the update!
It looks like we are in the opposite time-zones:)
A decent amount of the logic in the libressl, mbedtls, and eventual openssl modules is similar, maybe in the future there may be some opportunity for refactoring this and maybe setting the TLS module at compile time when compiling oatpp.
Having some kind of uber TLS module is definitely a good idea. Not sure about making it a part of core oatpp module though - oatpp by design works with streams. It doesn't care about where that stream comes from, is it TCP or Bluetooth or TLS over Bluetooth or whatever. You just take oatpp as a stream processor and plug any stream provider to it.
But we'll see how things will work out in the future.
oatpp-mongocxxmapper
an official module if enough data is aquired to prove its reliability. So we are really happy about any reports
@bhorn -- sample DTO
// StyleDto.hpp
// crud
//
// Created by Leonid on 3/13/18.
// Modified by Ryan Rajpaul 01/31/2020
// Copyright © 2018 oatpp. All rights reserved.
//
class StyleDto : public oatpp::data::mapping::type::Object {
DTO_INIT(StyleDto, Object)
DTO_FIELD(Int32, StyleId);
DTO_FIELD(String, Manufacturer, "Manufacturer");
DTO_FIELD(String, Brand, "Brand");
DTO_FIELD(String, Category, "Category");
DTO_FIELD(String, Type, "Type");
DTO_FIELD(String, Description, "Description");
};
@bhorn -- method below StyleDto::ObjectWrapper Database::getStyleById(v_int32 id){
bsoncxx::stdx::optional<bsoncxx::v_noabi::document::value> result =
m_db[COLLECTION_NAME].find_one({document{} << "StyleId" << id << finalize});
auto docView = result->view();
auto style = m_mongomapper->readFromDocument(docView);
if(style) {
OATPP_LOGD(TAG, "Found style with id %d", id);
return style;
}
return style;
}
@bhorn -- Method that will try to get a mongodb document by StyleId
StyleDto::ObjectWrapper Database::getStyleById(v_int32 id){
bsoncxx::stdx::optional<bsoncxx::v_noabi::document::value> result =
m_db[COLLECTION_NAME].find_one({document{} << "StyleId" << id << finalize});
auto docView = result->view();
auto style = m_mongomapper->readFromDocument(docView);
if(style) {
OATPP_LOGD(TAG, "Found style with id %d", id);
return style;
}
return style;
}
@bhorn sample json definition of a style document from style collection
{
"StyleId": NumberInt(4400),
"Manufacturer": "Acme Inc",
"Category": "Boys",
"Type": "Footwear",
"Description": "Running shoes"
}
Hello @codderembedded ,
I want to take base64 data, convert it to string and save it in txt file. How can I do it?
#include "oatpp/encoding/Base64.hpp"
...
oatpp::String base64Data = "SGVsbG8gV29ybGQh";
oatpp::String plainData = oatpp::encoding::Base64::decode(base64Data);
plainData->saveToFile("/path/to/file.txt");
How can I convert to std::string from oatpp::String?
oatpp::String oatppString = "Hello World!";
std::string stdString = oatppString->std_str();
ConversionUtils.hpp
- https://github.com/oatpp/oatpp/blob/master/src/oatpp/core/utils/ConversionUtils.hpp#L140
Hello @rrajpaul ,
How do I pass parameter for unit testing for example to test the crud method getUserById
The recommended way to test oatpp controllers is described here.
The basic idea - is that you create an ApiClient
for you ApiController
and then you do regular HTTP calls to your server.
Please let me know if you have more questions.
Regards,
Leonid