Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / extensions / api / log_private / log_parser.h
blobc73e54f012c6a882433f398b3d3f8943726871ba
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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_
8 #include <string>
9 #include <vector>
11 #include "base/memory/linked_ptr.h"
12 #include "chrome/browser/extensions/api/log_private/filter_handler.h"
13 #include "chrome/common/extensions/api/log_private.h"
15 namespace extensions {
17 // This is a abstract class of parsers for different logs.
18 // All the specific parsers inherit from this class.
19 class LogParser {
20 public:
21 enum Error {
22 SUCCESS = 0,
23 PARSE_ERROR = -1,
24 SERIALIZE_ERROR = -2,
25 TOKENIZE_ERROR = -3
28 virtual ~LogParser();
29 // Parses log text into multiple LogEntry objects.
30 void Parse(
31 const std::string& input,
32 std::vector<linked_ptr<api::log_private::LogEntry> >* output,
33 FilterHandler* filter_handler) const;
35 protected:
36 explicit LogParser();
37 // Parses a single line of log text into one LogEntry object.
38 virtual Error ParseEntry(
39 const std::string& input,
40 std::vector<linked_ptr<api::log_private::LogEntry> >* output,
41 FilterHandler* filter_handler) const = 0;
43 private:
44 DISALLOW_COPY_AND_ASSIGN(LogParser);
47 } // namespace extensions
49 #endif // CHROME_BROWSER_EXTENSIONS_API_LOG_PRIVATE_LOG_PARSER_H_