OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ |
6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ | 6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ |
7 | 7 |
8 #include "chrome/browser/parsers/metadata_parser.h" | 8 #include "chrome/browser/parsers/metadata_parser.h" |
9 | 9 |
| 10 namespace base { |
10 class FilePath; | 11 class FilePath; |
| 12 } |
11 | 13 |
12 // Used to check to see if a parser can parse a particular file, and allows | 14 // Used to check to see if a parser can parse a particular file, and allows |
13 // for creation of a parser on a particular file. | 15 // for creation of a parser on a particular file. |
14 class MetadataParserFactory { | 16 class MetadataParserFactory { |
15 public: | 17 public: |
16 MetadataParserFactory() {} | 18 MetadataParserFactory() {} |
17 virtual ~MetadataParserFactory() {} | 19 virtual ~MetadataParserFactory() {} |
18 | 20 |
19 // Used to check to see if the parser can parse the given file. This | 21 // Used to check to see if the parser can parse the given file. This |
20 // should not do any additional reading of the file. | 22 // should not do any additional reading of the file. |
21 virtual bool CanParse(const FilePath& path, | 23 virtual bool CanParse(const base::FilePath& path, |
22 char* bytes, | 24 char* bytes, |
23 int bytes_size) = 0; | 25 int bytes_size) = 0; |
24 | 26 |
25 // Creates the parser on the given file. Creating the parser does not | 27 // Creates the parser on the given file. Creating the parser does not |
26 // do any parsing on the file. Parse has to be called on the parser. | 28 // do any parsing on the file. Parse has to be called on the parser. |
27 virtual MetadataParser* CreateParser(const FilePath& path) = 0; | 29 virtual MetadataParser* CreateParser(const base::FilePath& path) = 0; |
28 }; | 30 }; |
29 | 31 |
30 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ | 32 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ |
OLD | NEW |