1 // Copyright 2015 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 CHROMECAST_BASE_SERIALIZERS_H_
6 #define CHROMECAST_BASE_SERIALIZERS_H_
10 #include "base/memory/scoped_ptr.h"
16 namespace chromecast
{
18 // Helper function which deserializes JSON |text| into a base::Value. If |text|
19 // is empty, is not valid JSON, or if some other deserialization error occurs,
20 // the return value will hold the NULL pointer.
21 scoped_ptr
<base::Value
> DeserializeFromJson(const std::string
& text
);
23 // Helper function which serializes |value| into a JSON string. If a
24 // serialization error occurs,the return value will hold the NULL pointer.
25 scoped_ptr
<std::string
> SerializeToJson(const base::Value
& value
);
27 } // namespace chromecast
29 #endif // CHROMECAST_BASE_SERIALIZERS_H_