+
+
+#ifdef __CYGWIN__
+static String
+dos_to_posix (String path)
+{
+ char buf[PATH_MAX];
+ char *filename = path.get_copy_str0 ();
+ /* urg, wtf? char const* argument gets modified! */
+ cygwin_conv_to_posix_path (filename, buf);
+ delete filename;
+ return buf;
+}
+
+static String
+dos_to_posix_list (String path)
+{
+ char *filename = path.get_copy_str0 ();
+ int len = cygwin_win32_to_posix_path_list_buf_size (filename);
+ if (len < PATH_MAX)
+ len = PATH_MAX;
+ char *buf = new char[len];
+ /* urg, wtf? char const* argument gets modified! */
+ cygwin_win32_to_posix_path_list (filename, buf);
+ delete filename;
+
+ String ret = buf;
+ delete buf;
+ return ret;
+}
+#endif /* __CYGWIN__ */
+
+/* Join components to full path. */
+String
+Path::string () const
+{
+ String s;
+ if (!root.empty_b ())
+ s = root + to_string (ROOTSEP);
+ if (!dir.empty_b ())
+ s += dir + to_string (DIRSEP);
+ s += base;
+ if (!ext.empty_b ())
+ s += to_string (EXTSEP) + ext;
+ return s;
+}
+