Skip to content

Commit

Permalink
formatting & comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Apr 7, 2024
1 parent 75ce7f3 commit fe49bcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions OdbDesignLib/IProtoBuffable.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Odb::Lib
class IProtoBuffable : public Utils::IJsonable
{
public:
// to and from Protocol Buffer messages
virtual std::unique_ptr<TPbMessage> to_protobuf() const = 0;
virtual void from_protobuf(const TPbMessage& message) = 0;

Expand All @@ -23,8 +24,8 @@ namespace Odb::Lib
bool from_pbstring(const std::string& pb_string);

// to and from output and input streams
bool serializeTo(std::ostream& outputStream) const;
bool parseFrom(std::istream& inputSream);
bool to_stream(std::ostream& outputStream) const;
bool from_stream(std::istream& inputStream);

// Inherited via IJsonConvertable
std::string to_json() const override;
Expand Down Expand Up @@ -57,18 +58,18 @@ namespace Odb::Lib
}

template<typename TPbMessage>
inline bool IProtoBuffable<TPbMessage>::serializeTo(std::ostream& outputStream) const
inline bool IProtoBuffable<TPbMessage>::to_stream(std::ostream& outputStream) const
{
auto pMessage = to_protobuf();
if (pMessage == nullptr) return false;
return pMessage->SerializeToOstream(&outputStream);
}

template<typename TPbMessage>
inline bool IProtoBuffable<TPbMessage>::parseFrom(std::istream& inputSream)
inline bool IProtoBuffable<TPbMessage>::from_stream(std::istream& inputStream)
{
auto pMessage = std::unique_ptr<TPbMessage>();
if (!pMessage->ParseFromIstream(&inputSream)) return false;
if (!pMessage->ParseFromIstream(&inputStream)) return false;
from_protobuf(*pMessage);
return true;
}
Expand Down
5 changes: 4 additions & 1 deletion OdbDesignServer/Controllers/FileUploadController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ namespace Odb::App::Server
{
// log to debug and skip rest of the loop
CROW_LOG_DEBUG << " Value: " << part_value.body << '\n';
CROW_LOG_ERROR << "multipart/form-data POST failed! Part name was: [" << part_name << "], which is not supported. Part name should be [" << MULTIPART_FORMDATA_PART_NAME << "].";
CROW_LOG_ERROR
<< "multipart/form-data POST failed! Part name was: [" << part_name
<< "], which is not supported. Part name should be [" << MULTIPART_FORMDATA_PART_NAME
<< "].";
continue;
}

Expand Down

0 comments on commit fe49bcf

Please sign in to comment.