Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: include/AdblockPlus/DefaultFileSystem.h

Issue 10369004: File system path resolving (Closed)
Left Patch Set: Created April 24, 2013, 2:10 a.m.
Right Patch Set: Addressing comments Created May 5, 2013, 10:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | include/AdblockPlus/FileSystem.h » ('j') | src/DefaultFileSystem.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #ifndef ADBLOCKPLUS_DEFAULT_FILE_SYSTEM_H 1 #ifndef ADBLOCK_PLUS_DEFAULT_FILE_SYSTEM_H
2 #define ADBLOCKPLUS_DEFAULT_FILE_SYSTEM_H 2 #define ADBLOCK_PLUS_DEFAULT_FILE_SYSTEM_H
3 3
4 #include "FileSystem.h" 4 #include "FileSystem.h"
5
6 #ifdef _WIN32
7 #define PATH_SEPARATOR '\\'
8 #else
9 #define PATH_SEPARATOR '/'
10 #endif
5 11
6 namespace AdblockPlus 12 namespace AdblockPlus
7 { 13 {
8 class DefaultFileSystem : public FileSystem 14 class DefaultFileSystem : public FileSystem
9 { 15 {
10 public: 16 public:
11 std::tr1::shared_ptr<std::istream> Read(const std::string& path) const; 17 std::tr1::shared_ptr<std::istream> Read(const std::string& path) const;
12 void Write(const std::string& path, 18 void Write(const std::string& path,
13 std::tr1::shared_ptr<std::ostream> data); 19 std::tr1::shared_ptr<std::ostream> data);
14 void Move(const std::string& fromPath, 20 void Move(const std::string& fromPath,
15 const std::string& toPath); 21 const std::string& toPath);
16 void Remove(const std::string& path); 22 void Remove(const std::string& path);
17 StatResult Stat(const std::string& path) const; 23 StatResult Stat(const std::string& path) const;
18 std::string Resolve(const std::string& path) const; 24 std::string Resolve(const std::string& path) const;
25 void SetBasePath(const std::string& path);
26 protected:
27 std::string basePath;
28
19 29
20 }; 30 };
21 } 31 }
22 32
23 #endif 33 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld