| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_METADATA_PARSER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_METADATA_PARSER_FACTORY_H_ |
| 6 #define CHROME_BROWSER_METADATA_PARSER_FACTORY_H_ | 6 #define CHROME_BROWSER_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 // Used to check to see if a parser can parse a particular file, and allows | 10 // Used to check to see if a parser can parse a particular file, and allows |
| 11 // for creation of a parser on a particular file. | 11 // for creation of a parser on a particular file. |
| 12 class MetadataParserFactory { | 12 class MetadataParserFactory { |
| 13 public: | 13 public: |
| 14 MetadataParserFactory() {} | 14 MetadataParserFactory() {} |
| 15 virtual ~MetadataParserFactory() {} | |
| 16 | 15 |
| 17 // Used to check to see if the parser can parse the given file. This | 16 // Used to check to see if the parser can parse the given file. This |
| 18 // should not do any additional reading of the file. | 17 // should not do any additional reading of the file. |
| 19 virtual bool CanParse(const FilePath& path, | 18 virtual bool CanParse(const FilePath& path, |
| 20 char* bytes, | 19 char* bytes, |
| 21 int bytes_size) = 0; | 20 int bytes_size) = 0; |
| 22 | 21 |
| 23 // Creates the parser on the given file. Creating the parser does not | 22 // Creates the parser on the given file. Creating the parser does not |
| 24 // do any parsing on the file. Parse has to be called on the parser. | 23 // do any parsing on the file. Parse has to be called on the parser. |
| 25 virtual MetadataParser* CreateParser(const FilePath& path) = 0; | 24 virtual MetadataParser* CreateParser(const FilePath& path) = 0; |
| 26 }; | 25 }; |
| 27 | 26 |
| 28 #endif // CHROME_BROWSER_METADATA_PARSER_FACTORY_H_ | 27 #endif // CHROME_BROWSER_METADATA_PARSER_FACTORY_H_ |
| OLD | NEW |