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 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ 6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ 7 8 #include "chrome/browser/parsers/metadata_parser.h" 9 10 namespace base { 11 class FilePath; 12 } 13 14 // Used to check to see if a parser can parse a particular file, and allows 15 // for creation of a parser on a particular file. 16 class MetadataParserFactory { 17 public: 18 MetadataParserFactory() {} 19 virtual ~MetadataParserFactory() {} 20 21 // Used to check to see if the parser can parse the given file. This 22 // should not do any additional reading of the file. 23 virtual bool CanParse(const base::FilePath& path, 24 char* bytes, 25 int bytes_size) = 0; 26 27 // Creates the parser on the given file. Creating the parser does not 28 // do any parsing on the file. Parse has to be called on the parser. 29 virtual MetadataParser* CreateParser(const base::FilePath& path) = 0; 30 }; 31 32 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_FACTORY_H_ 33