You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
change pe_bliss parent directory from /drivers to /tools
This commit is contained in:
60
tools/pe_bliss/message_table.cpp
Normal file
60
tools/pe_bliss/message_table.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#include "message_table.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace pe_bliss
|
||||
{
|
||||
//Default constructor
|
||||
message_table_item::message_table_item()
|
||||
:unicode_(false)
|
||||
{}
|
||||
|
||||
//Constructor from ANSI string
|
||||
message_table_item::message_table_item(const std::string& str)
|
||||
:unicode_(false), ansi_str_(str)
|
||||
{
|
||||
pe_utils::strip_nullbytes(ansi_str_);
|
||||
}
|
||||
|
||||
//Constructor from UNICODE string
|
||||
message_table_item::message_table_item(const std::wstring& str)
|
||||
:unicode_(true), unicode_str_(str)
|
||||
{
|
||||
pe_utils::strip_nullbytes(unicode_str_);
|
||||
}
|
||||
|
||||
//Returns true if contained string is unicode
|
||||
bool message_table_item::is_unicode() const
|
||||
{
|
||||
return unicode_;
|
||||
}
|
||||
|
||||
//Returns ANSI string
|
||||
const std::string& message_table_item::get_ansi_string() const
|
||||
{
|
||||
return ansi_str_;
|
||||
}
|
||||
|
||||
//Returns UNICODE string
|
||||
const std::wstring& message_table_item::get_unicode_string() const
|
||||
{
|
||||
return unicode_str_;
|
||||
}
|
||||
|
||||
//Sets ANSI string (clears UNICODE one)
|
||||
void message_table_item::set_string(const std::string& str)
|
||||
{
|
||||
ansi_str_ = str;
|
||||
pe_utils::strip_nullbytes(ansi_str_);
|
||||
unicode_str_.clear();
|
||||
unicode_ = false;
|
||||
}
|
||||
|
||||
//Sets UNICODE string (clears ANSI one)
|
||||
void message_table_item::set_string(const std::wstring& str)
|
||||
{
|
||||
unicode_str_ = str;
|
||||
pe_utils::strip_nullbytes(unicode_str_);
|
||||
ansi_str_.clear();
|
||||
unicode_ = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user