mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
Snapshot
This commit is contained in:
parent
5ac3f0c47e
commit
78e9b00a63
2 changed files with 29 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sstream>
|
||||
#include "StringTable.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -57,3 +58,27 @@ StringTable::~StringTable ()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// [data.location] / language . XX
|
||||
// UTF-8 encoding
|
||||
//
|
||||
// 123 This is the string
|
||||
// 124 This is another string
|
||||
// ...
|
||||
void StringTable::load (const std::string& file)
|
||||
{
|
||||
// TODO Load the specified file.
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string StringTable::get (int id)
|
||||
{
|
||||
// Return the right string.
|
||||
if (mMapping.find (id) != mMapping.end ())
|
||||
return mMapping[id];
|
||||
|
||||
std::stringstream error;
|
||||
error << "MISSING " << id;
|
||||
return error.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -38,8 +38,11 @@ public:
|
|||
StringTable& operator= (const StringTable&); // Assignment operator
|
||||
~StringTable (); // Destructor
|
||||
|
||||
void load (const std::string&);
|
||||
std::string get (int);
|
||||
|
||||
private:
|
||||
std::map <std::string, std::string> mMapping;
|
||||
std::map <int, std::string> mMapping;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue