chromium/components/policy/core/common/registry_dict.h

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_
#define COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_

#include <map>
#include <memory>
#include <optional>
#include <string>

#include "build/build_config.h"
#include "components/policy/policy_export.h"

#if BUILDFLAG(IS_WIN)
#include <windows.h>
#endif

namespace base {
class Value;
}

namespace policy {

class Schema;

// Converts a value (as read from the registry) to meet |schema|, converting
// types as necessary. Unconvertible types will show up as null values in the
// result.
std::optional<base::Value> POLICY_EXPORT
ConvertRegistryValue(const base::Value& value, const Schema& schema);

// A case-insensitive string comparison functor.
struct POLICY_EXPORT CaseInsensitiveStringCompare {};

// In-memory representation of a registry subtree. Using a
// base::Value::Dict directly seems tempting, but that doesn't handle the
// registry's case-insensitive-but-case-preserving semantics properly.
class POLICY_EXPORT RegistryDict {};

}  // namespace policy

#endif  // COMPONENTS_POLICY_CORE_COMMON_REGISTRY_DICT_H_