mirror of
https://github.com/akuker/RASCSI.git
synced 2025-07-25 05:24:17 +00:00
Improve code sharing and dependencies, address code duplication (#976)
This commit is contained in:
34
cpp/shared/protobuf_util.h
Normal file
34
cpp/shared/protobuf_util.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// SCSI Target Emulator RaSCSI Reloaded
|
||||
// for Raspberry Pi
|
||||
//
|
||||
// Copyright (C) 2021-2022 Uwe Seimet
|
||||
//
|
||||
// Helper methods for setting up/evaluating protobuf messages
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "google/protobuf/message.h"
|
||||
#include "generated/rascsi_interface.pb.h"
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
using namespace std;
|
||||
using namespace rascsi_interface;
|
||||
|
||||
namespace protobuf_util
|
||||
{
|
||||
static const char KEY_VALUE_SEPARATOR = '=';
|
||||
|
||||
void ParseParameters(PbDeviceDefinition&, const string&);
|
||||
string GetParam(const PbCommand&, const string&);
|
||||
string GetParam(const PbDeviceDefinition&, const string&);
|
||||
void SetParam(PbCommand&, const string&, string_view);
|
||||
void SetParam(PbDevice&, const string&, string_view);
|
||||
void SetParam(PbDeviceDefinition&, const string&, string_view);
|
||||
void SetPatternParams(PbCommand&, string_view);
|
||||
string ListDevices(const list<PbDevice>&);
|
||||
}
|
Reference in New Issue
Block a user