Skip to content

Commit 06055bb

Browse files
committed
remove boost dependency
1 parent 4e222ee commit 06055bb

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

apps/PoissonRecon/src/PoissonReconApp.cpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
#include <tinyxml2.h>
3131
#include <iostream>
3232
#include <string>
33-
#include "boost/format.hpp"
3433

3534
#include "Mesh/PoissonRecon/PoissonRecon.h"
3635

37-
template <typename... Int>
38-
std::string ParsePath(std::string path, Int... index)
36+
template <class... Int>
37+
std::string ParsePath(const std::string &path, const Int... index)
3938
{
4039
if (path.find('%') != std::string::npos)
4140
{
42-
std::vector<int> indices{{static_cast<int>(index)...}};
43-
44-
boost::format f(path);
45-
46-
for (std::vector<int>::const_iterator it = indices.begin();
47-
it != indices.end();
48-
it++)
49-
{
50-
f % *it;
51-
}
52-
53-
return boost::str(f);
54-
}
55-
else
56-
{
57-
return path;
41+
char buffer[4096];
42+
return std::string(
43+
buffer, std::snprintf(buffer, sizeof(buffer), path.c_str(), index...));
5844
}
45+
46+
return path;
5947
}
6048

6149
void usage()

apps/SurfaceTrimmer/src/SurfaceTrimmerApp.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ DAMAGE.
4141
#include <algorithm>
4242
#include <iostream>
4343
#include <string>
44-
#include "boost/format.hpp"
4544

4645
#include "Mesh/PoissonRecon/SurfaceTrimmer.h"
4746

48-
std::string ParsePath(std::string path, const int index)
47+
template <class... Int>
48+
std::string ParsePath(const std::string &path, const Int... index)
4949
{
5050
if (path.find('%') != std::string::npos)
5151
{
52-
return boost::str(boost::format(path) % index);
53-
}
54-
else
55-
{
56-
return path;
52+
char buffer[4096];
53+
return std::string(
54+
buffer, std::snprintf(buffer, sizeof(buffer), path.c_str(), index...));
5755
}
56+
57+
return path;
5858
}
5959

6060
void usage()

0 commit comments

Comments
 (0)