1 // Copyright (c) 2012 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 BASE_VALUE_CONVERSIONS_H_
6 #define BASE_VALUE_CONVERSIONS_H_
8 // This file contains methods to convert things to a |Value| and back.
11 #include "base/base_export.h"
17 class UnguessableToken;
20 // The caller takes ownership of the returned value.
21 BASE_EXPORT std::unique_ptr<Value> CreateFilePathValue(
22 const FilePath& in_value);
23 BASE_EXPORT bool GetValueAsFilePath(const Value& value, FilePath* file_path);
25 BASE_EXPORT std::unique_ptr<Value> CreateTimeDeltaValue(const TimeDelta& time);
26 BASE_EXPORT bool GetValueAsTimeDelta(const Value& value, TimeDelta* time);
28 BASE_EXPORT std::unique_ptr<Value> CreateUnguessableTokenValue(
29 const UnguessableToken& token);
30 BASE_EXPORT bool GetValueAsUnguessableToken(const Value& value,
31 UnguessableToken* token);
35 #endif // BASE_VALUE_CONVERSIONS_H_