mirror of https://github.com/akuker/RASCSI.git
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021-2022 Uwe Seimet
|
|
//
|
|
// Helper methods for serializing/deserializing protobuf messages
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "google/protobuf/message.h"
|
|
#include "rascsi_interface.pb.h"
|
|
#include "command_context.h"
|
|
#include "localizer.h"
|
|
#include <string>
|
|
|
|
using namespace rascsi_interface;
|
|
|
|
namespace command_util
|
|
{
|
|
void ParseParameters(PbDeviceDefinition&, const string&);
|
|
string GetParam(const PbCommand&, const string&);
|
|
string GetParam(const PbDeviceDefinition&, const string&);
|
|
void AddParam(PbCommand&, const string&, string_view);
|
|
void AddParam(PbDevice&, const string&, string_view);
|
|
void AddParam(PbDeviceDefinition&, const string&, string_view);
|
|
bool ReturnLocalizedError(const CommandContext&, LocalizationKey, const string& = "", const string& = "",
|
|
const string& = "");
|
|
bool ReturnLocalizedError(const CommandContext&, LocalizationKey, PbErrorCode, const string& = "",
|
|
const string& = "", const string& = "");
|
|
bool ReturnStatus(const CommandContext&, bool = true, const string& = "",
|
|
PbErrorCode = PbErrorCode::NO_ERROR_CODE, bool = true);
|
|
}
|