Files
yoga/benchmark/TreeDeserialization.h
Joe Vilches c278713eb5 Node -> Measure func map instead of vec (#1581)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1581

This is better than just trusting the order of the measure func call. Now each measure function I/O is associated with a node in the JSON.

Reviewed By: NickGerleman

Differential Revision: D53776790

fbshipit-source-id: 793cf2d9cbf6f663d24848af0af30aa297614eea
2024-02-21 18:02:58 -08:00

53 lines
1.2 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <memory>
#include <vector>
#include <capture/CaptureTree.h>
#include <nlohmann/json.hpp>
#include <yoga/Yoga.h>
namespace facebook::yoga {
using namespace nlohmann;
YGFlexDirection flexDirectionFromString(std::string str);
YGJustify justifyContentFromString(std::string str);
YGAlign alignFromString(std::string str);
YGWrap wrapFromString(std::string str);
YGOverflow overflowFromString(std::string str);
YGDisplay displayFromString(std::string str);
YGPositionType positionTypeFromString(std::string str);
YGUnit unitFromJson(json& j);
YGEdge edgeFromString(std::string str);
YGErrata errataFromString(std::string str);
YGExperimentalFeature experimentalFeatureFromString(std::string str);
std::string edgeStringFromPropertyName(
json::iterator it,
std::string propertyName);
YGDirection directionFromString(std::string str);
YGMeasureMode measureModeFromString(std::string str);
SerializedMeasureFunc serializedMeasureFuncFromJson(json& j);
} // namespace facebook::yoga