diff options
Diffstat (limited to 'components/policy/core/common/plist_writer.h')
-rw-r--r-- | components/policy/core/common/plist_writer.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/components/policy/core/common/plist_writer.h b/components/policy/core/common/plist_writer.h new file mode 100644 index 0000000000..0ad82235f7 --- /dev/null +++ b/components/policy/core/common/plist_writer.h @@ -0,0 +1,25 @@ +// Copyright 2018 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 COMPONENTS_POLICY_CORE_COMMON_PLIST_WRITER_H_ +#define COMPONENTS_POLICY_CORE_COMMON_PLIST_WRITER_H_ + +#include <stddef.h> +#include <string> +#include "base/values.h" +#include "components/policy/policy_export.h" + +namespace policy { + +// Given a root node, generates a Plist string and puts it into |plist|. +// The output string is overwritten and not appended. +// Return true on success and false on failure. +// TODO(rodmartin): Should we generate plist if it would be invalid plist +// (e.g., |node| is not a DictionaryValue/ListValue or if there are inf/-inf +// float values)? +POLICY_EXPORT bool PlistWrite(const base::Value& node, std::string* plist); + +} // namespace policy + +#endif // COMPONENTS_POLICY_CORE_COMMON_Plist_WRITER_H_
\ No newline at end of file |