Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: chrome/browser/common/ini_parser.h

Issue 16982004: Move Firefox importer's INI parser to c/browser/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/common/ini_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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_COMMON_INI_PARSER_H_
6 #define CHROME_BROWSER_COMMON_INI_PARSER_H_
7
8 #include <string>
9
10 #include "base/values.h"
11
12 // A simple class to parse INI files in a string. Users should inherit from this
13 // class and override the HandlePair method.
14 class INIParser {
15 public:
16 INIParser();
17 virtual ~INIParser();
18
19 // Pass by value because we will be sanitizing the string before parsing.
20 void Parse(const std::string& content);
21 private:
22 virtual void HandlePair(const std::string& section, const std::string& key,
23 const std::string& value) = 0;
24
25 DISALLOW_COPY_AND_ASSIGN(INIParser);
26 };
27
28 class DictionaryValueINIParser : public INIParser {
29 public:
30 DictionaryValueINIParser();
31 virtual ~DictionaryValueINIParser();
32
33 const DictionaryValue& root() const { return root_; }
34 private:
35 virtual void HandlePair(const std::string& section, const std::string& key,
36 const std::string& value) OVERRIDE;
37
38 DictionaryValue root_;
Lei Zhang 2013/06/13 23:21:17 base::
tommycli 2013/06/17 21:23:25 Done.
39
40 DISALLOW_COPY_AND_ASSIGN(DictionaryValueINIParser);
41 };
42
43 #endif // CHROME_BROWSER_COMMON_INI_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/common/ini_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698