Skip to content

Commit

Permalink
chnage StringPiece use to absl::string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Jan 18, 2025
1 parent 36526a5 commit 9e6cb27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OdbDesignLib/IProtoBuffable.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "odbdesign_export.h"
#include <ostream>
#include <istream>
#include <absl/strings/string_view.h>


namespace Odb::Lib
Expand Down Expand Up @@ -89,12 +90,11 @@ namespace Odb::Lib
template<typename TPbMessage>
inline void IProtoBuffable<TPbMessage>::from_json(const std::string& json)
{
google::protobuf::StringPiece sp_json(json);
// use default options
google::protobuf::util::JsonOptions jsonOptions;

auto pMessage = std::unique_ptr<TPbMessage>();
auto status = google::protobuf::util::JsonStringToMessage(sp_json, pMessage.get());
auto status = google::protobuf::util::JsonStringToMessage(absl::string_view(json), pMessage.get());
if (!status.ok()) return;
from_protobuf(*pMessage);
}
Expand Down

0 comments on commit 9e6cb27

Please sign in to comment.