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

Side by Side Diff: include/AdblockPlus/FileSystem.h

Issue 10518027: Don`t use stat() on Windows, use a Unicode-safe Windows function instead (Closed)
Patch Set: Created May 10, 2013, 3:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/DefaultFileSystem.cpp » ('j') | src/DefaultFileSystem.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 13 matching lines...) Expand all
24 24
25 #include "tr1_memory.h" 25 #include "tr1_memory.h"
26 26
27 namespace AdblockPlus 27 namespace AdblockPlus
28 { 28 {
29 class FileSystem 29 class FileSystem
30 { 30 {
31 public: 31 public:
32 struct StatResult 32 struct StatResult
33 { 33 {
34 inline StatResult()
Felix Dahlke 2013/05/17 09:18:50 The inline keyword is only necessary for free func
35 {
36 exists = false;
37 isDirectory = false;
38 isFile = false;
39 lastModified = false;
Felix Dahlke 2013/05/17 09:18:50 I think it'd be cleaner to set this to 0, being an
40 }
41
34 bool exists; 42 bool exists;
35 bool isDirectory; 43 bool isDirectory;
36 bool isFile; 44 bool isFile;
37 int64_t lastModified; 45 int64_t lastModified;
38 }; 46 };
39 47
40 virtual ~FileSystem() {} 48 virtual ~FileSystem() {}
41 virtual std::tr1::shared_ptr<std::istream> 49 virtual std::tr1::shared_ptr<std::istream>
42 Read(const std::string& path) const = 0; 50 Read(const std::string& path) const = 0;
43 virtual void Write(const std::string& path, 51 virtual void Write(const std::string& path,
44 std::tr1::shared_ptr<std::ostream> data) = 0; 52 std::tr1::shared_ptr<std::ostream> data) = 0;
45 virtual void Move(const std::string& fromPath, 53 virtual void Move(const std::string& fromPath,
46 const std::string& toPath) = 0; 54 const std::string& toPath) = 0;
47 virtual void Remove(const std::string& path) = 0; 55 virtual void Remove(const std::string& path) = 0;
48 virtual StatResult Stat(const std::string& path) const = 0; 56 virtual StatResult Stat(const std::string& path) const = 0;
49 virtual std::string Resolve(const std::string& path) const = 0; 57 virtual std::string Resolve(const std::string& path) const = 0;
50 }; 58 };
51 59
52 typedef std::tr1::shared_ptr<FileSystem> FileSystemPtr; 60 typedef std::tr1::shared_ptr<FileSystem> FileSystemPtr;
53 } 61 }
54 62
55 #endif 63 #endif
OLDNEW
« no previous file with comments | « no previous file | src/DefaultFileSystem.cpp » ('j') | src/DefaultFileSystem.cpp » ('J')

Powered by Google App Engine
This is Rietveld