[fix] compilation of this tag on windows
Some checks failed
Verification / Is-Buildable (push) Failing after 2m13s
Some checks failed
Verification / Is-Buildable (push) Failing after 2m13s
This commit is contained in:
parent
5634773eaf
commit
f9d6384f71
@ -6,16 +6,17 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "export.h"
|
||||||
namespace score {
|
namespace score {
|
||||||
|
|
||||||
class IRPCCoder {
|
class CRPC_EXPORT IRPCCoder {
|
||||||
public:
|
public:
|
||||||
virtual ~IRPCCoder() = default;
|
virtual ~IRPCCoder() = default;
|
||||||
virtual std::vector<char> decode(const std::string& encoded) = 0;
|
virtual std::vector<char> decode(const std::string& encoded) = 0;
|
||||||
virtual std::string encode(const std::vector<char>& data) = 0;
|
virtual std::string encode(const std::vector<char>& data) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Base64RPCCoder final : public IRPCCoder {
|
class CRPC_EXPORT Base64RPCCoder final : public IRPCCoder {
|
||||||
public:
|
public:
|
||||||
Base64RPCCoder();
|
Base64RPCCoder();
|
||||||
~Base64RPCCoder() override;
|
~Base64RPCCoder() override;
|
||||||
@ -24,4 +25,4 @@ public:
|
|||||||
std::string encode(const std::vector<char>& data) override;
|
std::string encode(const std::vector<char>& data) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -11,17 +11,18 @@ base64_dep = dependency('base64', fallback: ['aklomp-base64', 'base64'])
|
|||||||
cmake = import('cmake')
|
cmake = import('cmake')
|
||||||
glog_opt = cmake.subproject_options()
|
glog_opt = cmake.subproject_options()
|
||||||
glog_opt.add_cmake_defines({
|
glog_opt.add_cmake_defines({
|
||||||
'WITH_GFLAGS': 'OFF',
|
'WITH_GFLAGS': 'OFF',
|
||||||
'WITH_GTEST': 'OFF',
|
'WITH_GTEST': 'OFF',
|
||||||
'CMAKE_POLICY_VERSION_MINIMUM': '3.5'
|
'CMAKE_POLICY_VERSION_MINIMUM': '3.5'
|
||||||
})
|
})
|
||||||
|
|
||||||
libtype = get_option('default_library')
|
libtype = get_option('default_library')
|
||||||
if libtype == 'static'
|
if libtype == 'static'
|
||||||
message('Will share static state with glog')
|
message('Will share static state with glog')
|
||||||
glog_opt.add_cmake_defines({
|
glog_opt.add_cmake_defines({
|
||||||
'BUILD_SHARED_LIBS': 'OFF',
|
'BUILD_SHARED_LIBS': 'OFF',
|
||||||
})
|
})
|
||||||
|
add_project_arguments('-DBASE64_STATIC_DEFINE', '-DYAML_CPP_STATIC_DEFINE', language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
glog_proj = cmake.subproject('glog', options: glog_opt)
|
glog_proj = cmake.subproject('glog', options: glog_opt)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by vptyp on 11.03.2026.
|
// Created by vptyp on 11.03.2026.
|
||||||
//
|
//
|
||||||
#include "cloud_point_rpc/rpc_coder.h"
|
#include "cloud_point_rpc/rpc_coder.hpp"
|
||||||
|
|
||||||
#include "libbase64.h"
|
#include "libbase64.h"
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
@ -39,4 +39,4 @@ std::string Base64RPCCoder::encode(const std::vector<char>& data) {
|
|||||||
DLOG(INFO) << "result_len: " << result_len;
|
DLOG(INFO) << "result_len: " << result_len;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "cloud_point_rpc/config.hpp"
|
#include "cloud_point_rpc/config.hpp"
|
||||||
#include "cloud_point_rpc/rpc_coder.h"
|
#include "cloud_point_rpc/rpc_coder.hpp"
|
||||||
|
|
||||||
|
|
||||||
class Base64Test : public ::testing::Test {
|
class Base64Test : public ::testing::Test {
|
||||||
@ -28,4 +28,4 @@ TEST_F(Base64Test, EncodeDecode) {
|
|||||||
auto decoded = coder.decode(encoded);
|
auto decoded = coder.decode(encoded);
|
||||||
EXPECT_EQ(std::ranges::equal(decoded, raw), true);
|
EXPECT_EQ(std::ranges::equal(decoded, raw), true);
|
||||||
LOG(INFO) << "done";
|
LOG(INFO) << "done";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user