Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / policy / core / common / preg_parser_win.h
blob861fc7561dae3aca995957bb9d717e9e3a144845
1 // Copyright (c) 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 // This file provides a parser for PReg files which are used for storing group
6 // policy settings in the file system. The file format is documented here:
7 //
8 // http://msdn.microsoft.com/en-us/library/windows/desktop/aa374407(v=vs.85).aspx
10 #ifndef COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_
11 #define COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_
13 #include <vector>
15 #include "base/memory/scoped_ptr.h"
16 #include "base/strings/string16.h"
17 #include "components/policy/policy_export.h"
19 namespace base {
20 class FilePath;
23 namespace policy {
25 class PolicyLoadStatusSample;
26 class RegistryDict;
28 namespace preg_parser {
30 // The magic header in PReg files: ASCII "PReg" + version (0x0001).
31 POLICY_EXPORT extern const char kPRegFileHeader[8];
33 // Reads the PReg file at |file_path| and writes the registry data to |dict|.
34 // |root| specifies the registry subtree the caller is interested in,
35 // everything else gets ignored.
36 POLICY_EXPORT bool ReadFile(const base::FilePath& file_path,
37 const base::string16& root,
38 RegistryDict* dict,
39 PolicyLoadStatusSample* status);
41 } // namespace preg_parser
42 } // namespace policy
44 #endif // COMPONENTS_POLICY_CORE_COMMON_PREG_PARSER_WIN_H_