Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_BASE_JS_UTILS_H
8#define PXR_BASE_JS_UTILS_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/base/js/api.h"
14#include "pxr/base/js/value.h"
15
16#include <optional>
17#include <string>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21typedef std::optional<JsValue> JsOptionalValue;
22
27JS_API
28JsOptionalValue JsFindValue(
29 const JsObject& object,
30 const std::string& key,
31 const JsOptionalValue& defaultValue = std::nullopt);
32
33PXR_NAMESPACE_CLOSE_SCOPE
34
35#endif // PXR_BASE_JS_UTILS_H
JS_API JsOptionalValue JsFindValue(const JsObject &object, const std::string &key, const JsOptionalValue &defaultValue=std::nullopt)
Returns the value associated with key in the given object.