summaryrefslogtreecommitdiffstats
path: root/chrome/common/content_settings_pattern_parser.h
blob: 3638c5d2dbbeaae6fb1c20448d927e8a2c429767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_CONTENT_SETTINGS_PATTERN_PARSER_H_
#define CHROME_COMMON_CONTENT_SETTINGS_PATTERN_PARSER_H_

#include <string>

#include "base/basictypes.h"
#include "chrome/common/content_settings_pattern.h"

namespace content_settings {

struct PatternParts;

class PatternParser {
 public:
  static void Parse(const std::string& pattern_spec,
                    ContentSettingsPattern::BuilderInterface* builder);

  static std::string ToString(
      const ContentSettingsPattern::PatternParts& parts);

 private:
  static const char* kDomainWildcard;

  static const size_t kDomainWildcardLength;

  static const char* kSchemeWildcard;

  static const char* kHostWildcard;

  static const char* kPortWildcard;

  DISALLOW_COPY_AND_ASSIGN(PatternParser);
};

}  // namespace content_settings

#endif  // CHROME_COMMON_CONTENT_SETTINGS_PATTERN_PARSER_H_