*/
+#ifndef LIBSUB_STL_BINARY_TABLES_H
+#define LIBSUB_STL_BINARY_TABLES_H
+
#include <string>
#include <map>
+#include <boost/optional.hpp>
namespace sub {
DISPLAY_STANDARD_LEVEL_1_TELETEXT,
DISPLAY_STANDARD_LEVEL_2_TELETEXT
};
-
+
enum LanguageGroup {
LANGUAGE_GROUP_LATIN,
LANGUAGE_GROUP_LATIN_CYRILLIC,
COMMENT_YES
};
+/** @class STLBinaryCode
+ * @brief A value of some STL parameter and a human-readable description of what it means.
+ */
template<class T>
class STLBinaryCode
{
: value (v)
, description (d)
{}
-
+
T value;
std::string description;
};
+/** @class STLBinaryTables
+ * @brief A set of conversion tables for STL binary files.
+ */
class STLBinaryTables
{
public:
std::string justification_enum_to_description (Justification) const;
std::string comment_enum_to_description (Comment) const;
-private:
+ boost::optional<Language> language_description_to_enum (std::string) const;
+
+private:
std::map<std::string, STLBinaryCode<DisplayStandard> > _display_standard_map;
std::map<std::string, STLBinaryCode<LanguageGroup> > _language_group_map;
std::map<std::string, STLBinaryCode<Language> > _language_map;
};
}
+
+#endif