Skip to content

Commit

Permalink
patch: split fp_to_string.h into fptostring.h and fptostring.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Jul 29, 2024
1 parent 143e161 commit b7c6af1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 210 deletions.
2 changes: 1 addition & 1 deletion include/yaml-cpp/emitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "yaml-cpp/emittermanip.h"
#include "yaml-cpp/null.h"
#include "yaml-cpp/ostream_wrapper.h"
#include "yaml-cpp/fp_to_string.h"
#include "yaml-cpp/fptostring.h"

namespace YAML {
class Binary;
Expand Down
207 changes: 0 additions & 207 deletions include/yaml-cpp/fp_to_string.h

This file was deleted.

22 changes: 22 additions & 0 deletions include/yaml-cpp/fptostring.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2024 Simon Gene Gottlieb
// SPDX-License-Identifier: MIT

#ifndef YAML_H_FP_TO_STRING
#define YAML_H_FP_TO_STRING

#include "contrib/dragonbox.h"

#include <array>
#include <cassert>
#include <cmath>
#include <sstream>
#include <tuple>

namespace YAML {
// "precision = 0" refers to shortest known unique representation of the value
std::string FpToString(float v, size_t precision = 0);
std::string FpToString(double v, size_t precision = 0);
std::string FpToString(long double v, size_t precision = 0);
}

#endif
2 changes: 1 addition & 1 deletion include/yaml-cpp/node/convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "yaml-cpp/node/node.h"
#include "yaml-cpp/node/type.h"
#include "yaml-cpp/null.h"
#include "yaml-cpp/fp_to_string.h"
#include "yaml-cpp/fptostring.h"


namespace YAML {
Expand Down
2 changes: 1 addition & 1 deletion test/fp_to_string_test.cpp → test/fptostring_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "yaml-cpp/fp_to_string.h"
#include "yaml-cpp/fptostring.h"
#include "gtest/gtest.h"

namespace YAML {
Expand Down

0 comments on commit b7c6af1

Please sign in to comment.