String: Fixed conversion to int
[libacl.git] / src / String.h
index 118d855..d32b276 100644 (file)
@@ -105,9 +105,15 @@ public:
 
    /*  Numerical conversion */
 
+   String(int);              //  String x(12);  x = "12"
    String(long);             //  String x(12);  x = "12"
    String(unsigned long);    //  String x(12);  x = "12"
-   String(int);              //  String x(12);  x = "12"
+
+   operator int()
+   {
+      return strtol(p->s, 0, 0);
+   }
+
    operator long()
    {
       return strtol(p->s, 0, 0);
@@ -139,7 +145,6 @@ public:
       return strtod(p->s, 0);
    }
 
-   /*     */
 
    char& operator[](size_t i);    //  Individual character access