Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / parsers / metadata_parser_filebase.h
blob1431a61803085b8fa7e77d9dd164abd754d3c28c
1 // Copyright (c) 2011 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.
5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_FILEBASE_H_
6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_FILEBASE_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/containers/hash_tables.h"
12 #include "base/files/file_path.h"
13 #include "chrome/browser/parsers/metadata_parser.h"
15 typedef base::hash_map<std::string, std::string> PropertyMap;
17 // Parser for the file type. Allows for parsing of files, and gets
18 // properties associated with files.
19 class FileMetadataParser : public MetadataParser {
20 public:
21 explicit FileMetadataParser(const base::FilePath& path);
23 virtual ~FileMetadataParser();
25 // Implementation of MetadataParser
26 virtual bool Parse() OVERRIDE;
27 virtual bool GetProperty(const std::string& key, std::string* value) OVERRIDE;
29 virtual MetadataPropertyIterator* GetPropertyIterator() OVERRIDE;
31 protected:
32 PropertyMap properties_;
33 base::FilePath path_;
35 private:
36 DISALLOW_COPY_AND_ASSIGN(FileMetadataParser);
39 class FileMetadataPropertyIterator : public MetadataPropertyIterator {
40 public:
41 explicit FileMetadataPropertyIterator(PropertyMap& properties);
43 virtual ~FileMetadataPropertyIterator();
45 // Implementation of MetadataPropertyIterator
46 virtual bool GetNext(std::string* key, std::string* value) OVERRIDE;
47 virtual int Length() OVERRIDE;
48 virtual bool IsEnd() OVERRIDE;
50 private:
51 PropertyMap& properties_;
52 PropertyMap::iterator it;
54 DISALLOW_COPY_AND_ASSIGN(FileMetadataPropertyIterator);
57 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_FILEBASE_H_