1
0
Fork 0

[output] Maintenance

This commit is contained in:
scttgs0 2023-05-14 13:06:36 -05:00
parent 275d5cc4f6
commit b83c79f6b0
2 changed files with 52 additions and 48 deletions

View file

@ -24,7 +24,6 @@
#include <config.h>
#endif
#include <cstdlib>
#include <fstream>
#include <set>
#include <string>
@ -33,17 +32,18 @@
#include <simgear/bucket/newbucket.hxx>
#include <simgear/misc/sg_path.hxx>
using std::string;
// update index file (list of objects to be included in final scenery build)
void write_index_object( const string& base, const SGBucket& b, const string& name )
void write_index_object(const std::string& base, const SGBucket& b, const std::string& name)
{
string dir = base + "/" + b.gen_base_path();
using namespace std::string_literals;
std::string dir = base + "/"s + b.gen_base_path();
SGPath sgp(dir);
sgp.append( "dummy" );
sgp.append("dummy"s);
sgp.create_dir(0755);
string file = dir + "/" + b.gen_index_str() + ".ind";
std::string file = dir + "/"s + b.gen_index_str() + ".ind"s;
SG_LOG(SG_GENERAL, SG_DEBUG, "Writing object to " << file);
FILE* fp;
@ -58,16 +58,18 @@ void write_index_object( const string& base, const SGBucket& b, const string& na
// update index file (list of shared objects to be included in final scenery build)
void write_index_object_shared( const string &base, const SGBucket &b,
const SGGeod &p, const string& name,
void write_index_object_shared(const std::string& base, const SGBucket& b,
const SGGeod& p, const std::string& name,
const double& heading)
{
string dir = base + "/" + b.gen_base_path();
using namespace std::string_literals;
std::string dir = base + "/"s + b.gen_base_path();
SGPath sgp(dir);
sgp.append( "dummy" );
sgp.append("dummy"s);
sgp.create_dir(0755);
string file = dir + "/" + b.gen_index_str() + ".ind";
std::string file = dir + "/"s + b.gen_index_str() + ".ind"s;
SG_LOG(SG_GENERAL, SG_DEBUG, "Writing shared object to " << file);
FILE* fp;
@ -83,16 +85,18 @@ void write_index_object_shared( const string &base, const SGBucket &b,
// update index file (list of shared objects to be included in final scenery build)
void write_index_object_sign( const string &base, const SGBucket &b,
const SGGeod &p, const string& sign,
void write_index_object_sign(const std::string& base, const SGBucket& b,
const SGGeod& p, const std::string& sign,
const double& heading, const int& size)
{
string dir = base + "/" + b.gen_base_path();
using namespace std::string_literals;
std::string dir = base + "/"s + b.gen_base_path();
SGPath sgp(dir);
sgp.append( "dummy" );
sgp.append("dummy"s);
sgp.create_dir(0755);
string file = dir + "/" + b.gen_index_str() + ".ind";
std::string file = dir + "/"s + b.gen_index_str() + ".ind"s;
SG_LOG(SG_GENERAL, SG_DEBUG, "Writing sign to " << file);
FILE* fp;
@ -110,8 +114,7 @@ void write_index_object_sign( const string &base, const SGBucket &b,
// purge the existing index file when it already exists
void truncate_index_file(const std::string& fileName)
{
if (static_cast<bool>(std::ifstream(fileName)))
{
if (static_cast<bool>(std::ifstream(fileName))) {
SG_LOG(SG_GENERAL, SG_DEBUG, "Truncating file " << fileName);
std::ofstream fsIndex;

View file

@ -25,6 +25,7 @@
#include <config.h>
#endif
// update index file (list of objects to be included in final scenery build)
void write_index_object(const std::string& base, const SGBucket& b, const std::string& name);