32 #ifndef TBX_MESSAGEFILE_H_
33 #define TBX_MESSAGEFILE_H_
47 enum Status {CLOSED, OPENED, ATTACHED} _status;
54 bool open(
const std::string &file_name);
56 void attach(
int *messageFD);
61 bool is_open()
const {
return (_status != CLOSED);}
63 bool contains(
const std::string &token)
const;
65 std::string
message(
const std::string &token)
const;
66 std::string
message(
const std::string &token,
const std::string &arg0,
int max_size = 255)
const;
67 std::string
message(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
int max_size = 255)
const;
68 std::string
message(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
const std::string &arg2,
int max_size = 255)
const;
69 std::string
message(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
const std::string &arg2,
const std::string &arg3,
int max_size = 255)
const;
71 std::string
gsmessage(
const std::string &token,
int max_size = 255)
const;
72 std::string
gsmessage(
const std::string &token,
const std::string &arg0,
int max_size = 255)
const;
73 std::string
gsmessage(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
int max_size = 255)
const;
74 std::string
gsmessage(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
const std::string &arg2,
int max_size = 255)
const;
75 std::string
gsmessage(
const std::string &token,
const std::string &arg0,
const std::string &arg1,
const std::string &arg2,
const std::string &arg3,
int max_size = 255)
const;
MessageFile()
Unused message file constructor.
Definition: messagefile.cc:43
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
bool contains(const std::string &token) const
Checks to see if the message file contains the given token.
Definition: messagefile.cc:136
void attach(int *messageFD)
Attach this messages file class to the given message file descriptor.
Definition: messagefile.cc:123
bool open(const std::string &file_name)
Open a messages file.
Definition: messagefile.cc:89
~MessageFile()
Destructor - close file if opened with constructor or open function.
Definition: messagefile.cc:78
bool is_open() const
Returns true if message file is open.
Definition: messagefile.h:61
std::string message(const std::string &token) const
Get the string with the given token name without argument substitution.
Definition: messagefile.cc:159
void close()
Closes the message file if its has been successfully opened.
Definition: messagefile.cc:107
Class to lookup token translations from a messages file.
Definition: messagefile.h:43
std::string gsmessage(const std::string &token, int max_size=255) const
Get the string with the given token name and converts it from the GSTrans format.
Definition: messagefile.cc:309