This commit was manufactured by cvs2svn to create branch
[util-vserver.git] / src / vserver.hh
similarity index 50%
rename from lib/uint2str.c
rename to src/vserver.hh
index 5e99901..b0059dc 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: uint2str.c,v 1.1.2.1 2003/10/14 15:19:14 ensc Exp $    --*- c++ -*--
+// $Id: vserver.hh,v 1.1 2003/10/21 13:26:21 ensc Exp $    --*- c++ -*--
 
 // Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
 //  
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-#include "compat.h"
+#ifndef HH_UTIL_VSERVER_SRC_VSERVSER_HH
+#define HH_UTIL_VSERVER_SRC_VSERVSER_HH
 
-#include <assert.h>
-#include <stdbool.h>
-#include <string.h>
+#include <string>
+#include <ostream>
 
-size_t
-utilvserver_uint2str(char *buf, size_t len, unsigned int val, unsigned char base)
+class Vserver
 {
-  char                 *ptr = buf+len-1;
-  register size_t      res;
-  if (base>=36 || len==0) return 0;
-
-  *ptr = '\0';
-  while (ptr>buf) {
-    unsigned char      digit = val%base;
-    
-    --ptr;
-    *ptr = (digit<10 ? '0'+digit :
-           digit<36 ? 'a'+digit-10 :
-           (assert(false),'?'));
-
-    val /= base;
-    if (val==0) break;
-  }
-
-  assert(ptr>=buf && ptr<=buf+len-1);
-        
-  res = buf+len-ptr;
-  memmove(buf, ptr, res);
-
-  return res-1;
-}
+  public:
+    Vserver(std::string const &name);
+
+    std::string const &                getConfDir() const   { return conf_dir_; }
+    std::string const &                getVdir() const      { return vdir_; }
+    std::string const &                getRPMDbPath() const { return rpmdb_path_; }
+    std::string const &                getName() const      { return name_; }
+
+  private:
+    std::string                conf_dir_;
+    std::string                vdir_;
+    std::string                rpmdb_path_;
+    std::string                name_;
+};
+
+std::ostream & operator << (std::ostream &lhs, Vserver const &rhs);
+
+
+#endif //  HH_UTIL_VSERVER_SRC_VSERVSER_HH