summaryrefslogtreecommitdiff
path: root/xml/skin.c
diff options
context:
space:
mode:
Diffstat (limited to 'xml/skin.c')
-rw-r--r--xml/skin.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/xml/skin.c b/xml/skin.c
index 6f3e938..2935dee 100644
--- a/xml/skin.c
+++ b/xml/skin.c
@@ -9,6 +9,37 @@
const std::string ScreenBases[] = { "relative", "absolute" };
+cxVersion::cxVersion(int ma, int min):
+ mMajor(ma),
+ mMinor(min)
+{
+}
+
+bool cxVersion::Parse(const std::string &Text)
+{
+ int dot = Text.find(".");
+ std::string ma(Text, 0, dot), min(Text, dot + 1);
+ char *e = NULL;
+ const char *t = NULL;
+ long l = 0;
+
+ t = ma.c_str();
+ l = strtol(t, &e, 10);
+ if (e == t || *e != '\0')
+ return false;
+ else
+ mMajor = l;
+
+ t = min.c_str();
+ l = strtol(t, &e, 10);
+ if (e == t || *e != '\0')
+ return false;
+ else
+ mMinor = l;
+
+ return true;
+}
+
cxSkin::cxSkin(const std::string &Name, cText2SkinI18n *I18n, cText2SkinTheme *Theme):
mName(Name),
mI18n(I18n),