Zoltan2
Loading...
Searching...
No Matches
Zoltan2_IO.cpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Zoltan2: A package of combinatorial algorithms for scientific computing
4//
5// Copyright 2012 NTESS and the Zoltan2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
16#include <Zoltan2_IO.hpp>
17
18namespace Zoltan2{
19
20void addNumberToFileName(int number, std::string fname, std::string &newf)
21{
22 std::ostringstream id;
23 id << "_";
24 id.width(6);
25 id.fill('0');
26 id << number;
27
28 std::ostringstream localFileName;
29 std::string::size_type loc = fname.find('.');
30
31 if (loc == std::string::npos)
32 localFileName << fname << id.str();
33 else
34 localFileName << fname.substr(0, loc) << id.str() << fname.substr(loc);
35
36 newf = localFileName.str();
37}
38
39} // namespace Zoltan2
40
Declaration of methods to assist in file input/output.
Created by mbenlioglu on Aug 31, 2020.
void addNumberToFileName(int number, std::string fname, std::string &newf)
Helper method to add number to a file name.