blob: e71560c20095d158cdfbc5df8fa3a95b7921d949 [file] [log] [blame]
Alex Vakulenkob04936f2014-09-19 14:53:58 -07001// Copyright 2014 The Chromium OS 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.
4
5#ifndef BUFFET_UTILS_H_
6#define BUFFET_UTILS_H_
7
8#include <memory>
9
10#include <base/values.h>
11#include <base/files/file_path.h>
12#include <chromeos/errors/error.h>
13
14namespace buffet {
15
16extern const char kErrorDomainBuffet[];
17extern const char kFileReadError[];
18
19// Helper function to load a JSON file that is expected to be
20// an object/dictionary. In case of error, returns empty unique ptr and fills
21// in error details in |error|.
22std::unique_ptr<const base::DictionaryValue> LoadJsonDict(
23 const base::FilePath& json_file_path, chromeos::ErrorPtr* error);
24
25} // namespace buffet
26
27#endif // BUFFET_UTILS_H_