mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-08 20:29:30 +00:00
1df7cdb1f3
* Use vector for INQUIRY data, Inquiry() is const, moved EVPD check
* Moved code
* Fixed warning
* Updated memcpy
* Set length
* Limit result vector size
* Limit result buffer size
* Inquiry() result buffer handling update
* Logging update
* Inquiry cleanup
* NEC drive can also use PrimaryDevice::Inquiry()
* NEC drive is never removable
* Comment update
* Bridge can also use PrimaryDevice::Inquiry()
* Removed unused method argument
* Comment update
* Updated comment
* Updated REQUEST SENSE buffer handling
* Fixed typo
* Fixed typo
* Re-added comment
* Updated additional length handling
* Check for INQUIRY command support first
* Added assertion
* Size handling update
* Renaming
* Renaming
* Removed obsolete casts
* Cleanup
* Moved error codes to scsi_defs namespace
* Fixed ReadDefectData10
* Comment update
* Updated buffer handling
* Data type update
* SendDiagnostic is now const
* Removed obsolete forward declaration
* removed unused enum
* Reduced method visibility
* Renaming
* GetSendDelay() can be const
* Made method const
* Made method const
* Added TODO
* Use iterator
* Made method const
* Revert "Made method const"
This reverts commit 38412b8ddd
.
* No need to sort all set/maps
* Do not sort all sets
* Removed more unnecessary sorting
* Cleaned up includes
* More include cleanups
* Updated REPORT LUNS
* LUNs must not be consecutive anymore
* Updated detaching of LUN
* Improvements for devices without LUN 0
* Assume LUN 0 is always present
* Enforce presence of LUN 0
* Updated error handling
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2021 Uwe Seimet
|
|
//
|
|
// Message localization support. Currently only for messages with up to 3 string parameters.
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <unordered_set>
|
|
#include <unordered_map>
|
|
|
|
using namespace std;
|
|
|
|
enum LocalizationKey {
|
|
ERROR_AUTHENTICATION,
|
|
ERROR_OPERATION,
|
|
ERROR_LOG_LEVEL,
|
|
ERROR_MISSING_DEVICE_ID,
|
|
ERROR_MISSING_FILENAME,
|
|
ERROR_IMAGE_IN_USE,
|
|
ERROR_RESERVED_ID,
|
|
ERROR_NON_EXISTING_DEVICE,
|
|
ERROR_NON_EXISTING_UNIT,
|
|
ERROR_UNKNOWN_DEVICE_TYPE,
|
|
ERROR_MISSING_DEVICE_TYPE,
|
|
ERROR_DUPLICATE_ID,
|
|
ERROR_SASI_SCSI,
|
|
ERROR_EJECT_REQUIRED,
|
|
ERROR_DEVICE_NAME_UPDATE,
|
|
ERROR_SHUTDOWN_MODE_MISSING,
|
|
ERROR_SHUTDOWN_MODE_INVALID,
|
|
ERROR_SHUTDOWN_PERMISSION,
|
|
ERROR_FILE_OPEN,
|
|
ERROR_BLOCK_SIZE,
|
|
ERROR_BLOCK_SIZE_NOT_CONFIGURABLE
|
|
};
|
|
|
|
class Localizer
|
|
{
|
|
public:
|
|
|
|
Localizer();
|
|
~Localizer() {};
|
|
|
|
string Localize(LocalizationKey, const string&, const string& = "", const string& = "", const string& = "");
|
|
|
|
private:
|
|
|
|
void Add(LocalizationKey, const string&, const string&);
|
|
unordered_map<string, unordered_map<LocalizationKey, string>> localized_messages;
|
|
|
|
unordered_set<string> supported_languages;
|
|
};
|