*
*/
-#ifndef _IO_STREAM_CYGFILE_H_
-#define _IO_STREAM_CYGFILE_H_
+#ifndef SETUP_IO_STREAM_CYGFILE_H
+#define SETUP_IO_STREAM_CYGFILE_H
+
+#include "io_stream.h"
/* io_stream on disk files using cygwin paths
* and potentially understanding links in the future
*/
-extern int cygmkdir_p (int isadir, const char *path);
+extern int cygmkdir_p (path_type_t isadir, const std::string& path, mode_t mode);
class io_stream_cygfile:public io_stream
{
public:
- static int exists (const char *);
- static int remove (const char *);
- static int mklink (const char *, const char *, io_stream_link_t);
- io_stream_cygfile (const char *, const char *);
+ static int exists (const std::string& );
+ static int remove (const std::string& );
+ static int mklink (const std::string& , const std::string& , io_stream_link_t);
+ io_stream_cygfile (const std::string&, const std::string&, mode_t);
virtual ~ io_stream_cygfile ();
/* read data (duh!) */
virtual ssize_t read (void *buffer, size_t len);
virtual int seek (long where, io_stream_seek_t whence);
/* can't guess, oh well */
virtual int error ();
- virtual int set_mtime (int);
+ virtual int set_mtime (time_t);
/* not relevant yet */
- virtual int get_mtime ()
- {
- return 0;
- };
- /* dummy for io_stream_file */
- virtual const char *next_file_name ()
- {
- return NULL;
- };
- static int move (char const *, char const *);
+ virtual time_t get_mtime () { return 0; };
+ virtual mode_t get_mode () { return 0; };
+ virtual size_t get_size ();
+ static int move (const std::string& ,const std::string& );
private:
/* always require parameters */
io_stream_cygfile ()
{
};
+ friend int cygmkdir_p (path_type_t isadir, const std::string& _name, mode_t mode);
+ static std::string normalise (const std::string& unixpath);
FILE *fp;
int lasterr;
- char *fname;
- char *lmode;
+ std::string fname;
+ wchar_t *wname;
+ wchar_t *w_str ();
+ static std::string cwd;
};
-#endif /* _IO_STREAM_CYGFILE_H_ */
+#endif /* SETUP_IO_STREAM_CYGFILE_H */