~skinny.moey/drizzle/innodb-replication

« back to all changes in this revision

Viewing changes to plugin/pbms/src/cslib/CSPath.h

  • Committer: Brian Aker
  • Date: 2010-11-08 22:35:57 UTC
  • mfrom: (1802.1.114 trunk)
  • Revision ID: brian@tangent.org-20101108223557-w3xzwp9hjjtjhtc1
MergeĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 *
19
19
 * Original author: Paul McCullagh
20
20
 * Continued development: Barry Leslie
37
37
#include "CSTime.h"
38
38
#include "CSDefs.h"
39
39
#include "CSString.h"
40
 
 
41
 
using namespace std;
 
40
#include "CSSys.h"
42
41
 
43
42
class CSFile;
44
43
class CSDirectory;
45
44
 
46
 
class CSPath : public CSRefObject {
 
45
class CSPath : public CSRefObject, public CSSys {
47
46
public:
48
47
        virtual CSFile *createFile(int mode);
49
48
 
65
64
        /* Delete the contents of a directory */
66
65
        virtual void emptyDir();
67
66
        
 
67
        /* Recursively delete the contents of a directory */
 
68
        virtual void emptyPath();
 
69
        
68
70
        /* Copy a file or directory to the specified location. */
69
71
        virtual void copyTo(CSPath *to_path, bool overwrite);
70
72
 
76
78
        virtual void remove();
77
79
 
78
80
        /* Create an empty file. */
79
 
        virtual void touch(bool create_path);
 
81
        virtual void touch(bool create_path = false);
80
82
 
81
83
        virtual CSString *getString();
82
84
 
92
94
 
93
95
        virtual bool exists() { return exists(NULL); }
94
96
 
 
97
        static void info(const char *path, bool *is_dir, off64_t *size, CSTime *mod_time);
 
98
 
95
99
        virtual void info(bool *is_dir, off64_t *size, CSTime *mod_time);
96
100
 
97
 
        virtual off64_t getSize();
 
101
        static off64_t getSize(const char *path);
 
102
        
 
103
        virtual off64_t getSize();
98
104
 
99
105
        virtual bool isDir();
100
106
 
137
143
        static CSPath *newPath(const char *cwd, const char *path);
138
144
 
139
145
private:
 
146
        CSFile *try_CreateAndOpen(CSThread *self, int mode, bool retry);
 
147
        static CSLock iRename_lock;
140
148
        CSPath():iPath(NULL) { }
141
149
 
142
150
        virtual ~CSPath();