Commit 8eebe069 authored by Marco Amagliani's avatar Marco Amagliani

added t-spline out (jira72) and improved a bit the debug system in order to...

added t-spline out (jira72) and improved a bit the debug system in order to reuse functions. Also the debug output is now more clear becuase all debug files use the some numbering.

[git-p4: depot-paths = "//ReForm/ReForm/main/Base/": change = 13609]
parent 384c42c1
set(my_headers
${CMAKE_CURRENT_SOURCE_DIR}/DebError.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebFileOut.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebOut.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebTime.hh
${CMAKE_CURRENT_SOURCE_DIR}/DebUtils.hh
......@@ -7,6 +8,7 @@ set(my_headers
)
set(my_sources
${CMAKE_CURRENT_SOURCE_DIR}/DebFileOut.cc
${CMAKE_CURRENT_SOURCE_DIR}/DebStream.cc
PARENT_SCOPE
)
#include "DebFileOut.hh"
#include <string>
#include <sstream>
#include <iomanip>
namespace Debug {
std::string make_filename(const char* _prfx, const char* _flnm,
const char* _ext, const char* _sfx)
{
static int cnt = 0;
const char SEP = '_';
std::stringstream sstr_flnm;
sstr_flnm << std::setfill('0') << std::setw(4) << cnt++;
sstr_flnm << SEP << _prfx << SEP << _flnm;
if (_sfx != nullptr)
sstr_flnm << SEP << _sfx;
sstr_flnm << '.' << _ext;
return sstr_flnm.str();
}
std::string set_filename_extension(const char* _flnm, const char* _ext)
{
std::string flnm(_flnm);
const size_t dot_pos = flnm.find_last_of('.');
if (dot_pos != std::string::npos)
flnm.replace(flnm.begin() + dot_pos + 1, flnm.end(), _ext);
else
flnm += std::string(".") + _ext;
return flnm;
}
} // Debug
// (C) Copyright 2014 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk, Inc., and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of this information by anyone other than authorized
// employees of Autodesk, Inc. is granted only under a written
// non-disclosure agreement, expressly prescribing the scope
// and manner of such use.
#ifndef BASE_DEBFILEOUT_HH_INCLUDED
#define BASE_DEBFILEOUT_HH_INCLUDED
#ifdef DEB_ON
#include <string>
namespace Debug {
//! Make a file name composing the input arguments:
// prefix_filname_[suffix_]#count#.ext
// count is a number that increase any time the function is called,
// it is expressed with 4 decimal digits filled with zeros.
std::string make_filename(const char* _prfx, const char* _flnm,
const char* _ext, const char* _sfx = nullptr);
std::string set_filename_extension(const char* _flnm, const char* _ext);
} // Debug
#endif // DEB_ON
#endif // BASE_DEBFILEOUT_HH_INCLUDED
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment