]> git.donarmstrong.com Git - mothur.git/blobdiff - uchime_src/path.h
added uchime_src folder. added biom parameter to make.shared. added biom as a current...
[mothur.git] / uchime_src / path.h
diff --git a/uchime_src/path.h b/uchime_src/path.h
new file mode 100644 (file)
index 0000000..f63be7e
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef path_h\r
+#define path_h\r
+\r
+struct PathData\r
+       {\r
+private:\r
+       PathData(PathData &);\r
+       PathData &operator=(PathData &);\r
+\r
+public:\r
+       char *Start;\r
+       char *Front;\r
+       char *Back;\r
+       unsigned Bytes;\r
+\r
+public:\r
+       PathData()\r
+               {\r
+               Clear(true);\r
+               }\r
+       ~PathData()\r
+               {\r
+               Free();\r
+               }\r
+       void Free();\r
+       void Alloc(unsigned MaxLen);\r
+       void Clear(bool ctor = false)\r
+               {\r
+               Start = 0;\r
+               if (ctor)\r
+                       {\r
+                       Front = 0;\r
+                       Back = 0;\r
+                       Bytes = 0;\r
+                       }\r
+               else\r
+                       Free();\r
+               }\r
+       void Copy(const PathData &rhs);\r
+       void FromStr(const char *PathStr);\r
+       void Reverse()\r
+               {\r
+               asserta(Start != 0);\r
+               unsigned L = (unsigned) strlen(Start);\r
+               for (unsigned k = 0; k < L/2; ++k)\r
+                       {\r
+                       char c = Start[k];\r
+                       Start[k] = Start[L-k-1];\r
+                       Start[L-k-1] = c;\r
+                       }\r
+               }\r
+       void SetEmpty()\r
+               {\r
+               Start = 0;\r
+               }\r
+\r
+       bool IsEmpty() const\r
+               {\r
+               return Start == 0;\r
+               }\r
+       };\r
+\r
+#endif // path_h\r