diff --git a/src/app/editor/message/message_editor.h b/src/app/editor/message/message_editor.h index f5414075..222cface 100644 --- a/src/app/editor/message/message_editor.h +++ b/src/app/editor/message/message_editor.h @@ -45,22 +45,22 @@ static int defaultColor = 6; static std::vector ParseMessageToData(string str); static string AddNewLinesToCommands(string str); static string ReplaceAllDictionaryWords(string str); +const std::string CHEESE = "\uBEBE"; // Inserted into commands to protect + // them from dictionary replacements. struct MessageData { - const std::string CHEESE = "\uBEBE"; // Inserted into commands to protect - // them from dictionary replacements. - + int ID; + int Address; std::string RawString; std::string ContentsParsed; - int ID; std::vector Data; std::vector DataParsed; - int Address; MessageData() = default; - MessageData(int id, int address, std::string rawString, - std::vector rawData, std::string parsedString, - std::vector parsedData) + MessageData(int id, int address, const std::string& rawString, + const std::vector& rawData, + const std::string& parsedString, + const std::vector& parsedData) : ID(id), Address(address), RawString(rawString), @@ -68,6 +68,16 @@ struct MessageData { DataParsed(parsedData), ContentsParsed(parsedString) {} + // Copy constructor + MessageData(const MessageData& other) { + ID = other.ID; + Address = other.Address; + RawString = other.RawString; + Data = other.Data; + DataParsed = other.DataParsed; + ContentsParsed = other.ContentsParsed; + } + void SetMessage(std::string messageString) { ContentsParsed = messageString; RawString = OptimizeMessageForDictionary(messageString);