Skip to content
Snippets Groups Projects
Commit 43537cee authored by florian's avatar florian
Browse files

Merge branch 'dev' into f-consolidate-c

parents af6ed76a f0fc164f
No related branches found
No related tags found
1 merge request!13ENH: Add datatypes and value classes to Extern C interface
Pipeline #12319 passed
Pipeline: caosdb-cppinttest

#12326

    This commit is part of merge request !13. Comments created here will be created in the context of that merge request.
    ......@@ -367,7 +367,8 @@ public:
    * This is intended for debugging.
    */
    inline auto ToString() const -> const std::string {
    google::protobuf::util::JsonOptions options;
    google::protobuf::util::JsonPrintOptions options;
    options.add_whitespace = true;
    std::string out;
    google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
    return out;
    ......@@ -538,10 +539,10 @@ public:
    * This is intended for debugging
    */
    inline auto ToString() const -> const std::string {
    google::protobuf::util::JsonOptions options;
    google::protobuf::util::JsonPrintOptions options;
    options.add_whitespace = true;
    std::string out;
    google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
    return out;
    }
    ......@@ -649,7 +650,8 @@ public:
    [[nodiscard]] auto GetInfos() const -> const Messages & { return infos; }
    inline auto ToString() const -> const std::string {
    google::protobuf::util::JsonOptions options;
    google::protobuf::util::JsonPrintOptions options;
    options.add_whitespace = true;
    std::string out;
    google::protobuf::util::MessageToJsonString(*(this->wrapped), &out, options);
    return out;
    ......
    ......@@ -391,7 +391,8 @@ public:
    * For debugging.
    */
    inline auto ResponseToString() const -> const std::string {
    google::protobuf::util::JsonOptions options;
    google::protobuf::util::JsonPrintOptions options;
    options.add_whitespace = true;
    std::string out;
    google::protobuf::util::MessageToJsonString(*this->response, &out, options);
    return out;
    ......@@ -403,7 +404,8 @@ public:
    * For debugging.
    */
    inline auto RequestToString() const -> const std::string {
    google::protobuf::util::JsonOptions options;
    google::protobuf::util::JsonPrintOptions options;
    options.add_whitespace = true;
    std::string out;
    google::protobuf::util::MessageToJsonString(*this->request, &out, options);
    return out;
    ......
    ......@@ -122,7 +122,7 @@ public:
    LIST_VALUE_CONSTRUCTOR(char *, set_string_value)
    LIST_VALUE_CONSTRUCTOR(bool, set_boolean_value)
    [[nodiscard]] inline auto IsNull() -> bool {
    [[nodiscard]] inline auto IsNull() const noexcept -> bool {
    return this->wrapped->value_case() == ValueCase::VALUE_NOT_SET;
    }
    ......
    ......@@ -65,6 +65,11 @@ TEST(test_value, test_string) {
    EXPECT_FALSE(empty_string.IsInteger());
    EXPECT_EQ(empty_string.AsString(), "");
    // Test inequality
    Value string1("1");
    Value int1(1);
    EXPECT_FALSE(string1 == int1);
    }
    TEST(test_value, test_double) {
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment