Files
yoga/capture/CaptureTree.cpp
Joe Vilches 753b319977 Support for (de)serializing node state (#1570)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1570

X-link: https://github.com/facebook/react-native/pull/42751

tsia. Need node state

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53206323

fbshipit-source-id: eb48c3873536eb52c8ffcce8005725da274e5373
2024-02-09 16:44:32 -08:00

27 lines
618 B
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.
*/
#include <fstream>
#include <capture/CaptureTree.h>
#include <capture/NodeToString.h>
namespace facebook::yoga {
void captureTree(YGNodeRef node, const std::filesystem::path& path) {
std::string str;
nodeToString(
str,
node,
PrintOptions::Style | PrintOptions::Children | PrintOptions::Config |
PrintOptions::Node);
std::ofstream file(path);
file << str;
}
} // namespace facebook::yoga