fixed a few boost::filesystem string issues
parent
c52fa6402b
commit
15ca0811a0
|
@ -530,7 +530,7 @@ void exportAnimation(ColladaContext &ctx, const fs::path &path, const std::strin
|
|||
continue;
|
||||
trafo->addTrack(track);
|
||||
}
|
||||
SLog(EDebug, "Writing animation track \"%s\"", path.filename().c_str());
|
||||
SLog(EDebug, "Writing animation track \"%s\"", path.filename().string().c_str());
|
||||
ref<FileStream> fs = new FileStream(path, FileStream::ETruncReadWrite);
|
||||
trafo->serialize(fs);
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
m_filename = Thread::getThread()->getFileResolver()->resolve(
|
||||
props.getString("filename"));
|
||||
|
||||
Log(EInfo, "Loading environment map \"%s\"", m_filename.filename().c_str());
|
||||
Log(EInfo, "Loading environment map \"%s\"", m_filename.filename().string().c_str());
|
||||
if (!fs::exists(m_filename))
|
||||
Log(EError, "Environment map file \"%s\" could not be found!", m_filename.c_str());
|
||||
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
bitmap = new Bitmap(Bitmap::EAuto, fs);
|
||||
if (m_gamma != 0)
|
||||
bitmap->setGamma(m_gamma);
|
||||
Log(EDebug, "Loaded \"%s\" in %i ms", m_filename.filename().c_str(),
|
||||
Log(EDebug, "Loaded \"%s\" in %i ms", m_filename.filename().string().c_str(),
|
||||
timer->getMilliseconds());
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
EnvironmentMap(Stream *stream, InstanceManager *manager) : Emitter(stream, manager),
|
||||
m_mipmap(NULL), m_cdfRows(NULL), m_cdfCols(NULL), m_rowWeights(NULL) {
|
||||
m_filename = stream->readString();
|
||||
Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().c_str());
|
||||
Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().string().c_str());
|
||||
m_gamma = stream->readFloat();
|
||||
m_scale = stream->readFloat();
|
||||
m_sceneBSphere = BSphere(stream);
|
||||
|
|
|
@ -249,7 +249,7 @@ public:
|
|||
ref<Bitmap> bitmap = m_storage->getBitmap()->convert(
|
||||
m_pixelFormat, Bitmap::EFloat);
|
||||
|
||||
Log(EInfo, "Writing image to \"%s\" ..", filename.filename().c_str());
|
||||
Log(EInfo, "Writing image to \"%s\" ..", filename.filename().string().c_str());
|
||||
|
||||
fs::ofstream os(filename);
|
||||
if (!os.good() || os.fail())
|
||||
|
|
|
@ -97,7 +97,7 @@ void BDPTWorkResult::dump(const BDPTConfiguration &conf,
|
|||
Bitmap *bitmap = const_cast<Bitmap *>(m_debugBlocks[strategyIndex(s, t)]->getBitmap());
|
||||
ref<Bitmap> ldrBitmap = bitmap->convert(Bitmap::ERGB, Bitmap::EUInt8, -1, weight);
|
||||
fs::path filename =
|
||||
prefix / fs::path(formatString("%s_k%02i_s%02i_t%02i.png", stem.filename().c_str(), k, s, t));
|
||||
prefix / fs::path(formatString("%s_k%02i_s%02i_t%02i.png", stem.filename().string().c_str(), k, s, t));
|
||||
ref<FileStream> targetFile = new FileStream(filename,
|
||||
FileStream::ETruncReadWrite);
|
||||
ldrBitmap->write(Bitmap::EPNG, targetFile, 1);
|
||||
|
|
|
@ -26,7 +26,7 @@ struct MemoryMappedFile::MemoryMappedFilePrivate
|
|||
MemoryMappedFile::MemoryMappedFile(const fs::path &filename, size_t size)
|
||||
: d(new MemoryMappedFilePrivate(filename, size)) {
|
||||
Log(ETrace, "Creating memory-mapped file \"%s\" (%s)..",
|
||||
filename.filename().c_str(), memString(d->size).c_str());
|
||||
filename.filename().string().c_str(), memString(d->size).c_str());
|
||||
#if defined(__LINUX__) || defined(__OSX__)
|
||||
int fd = open(filename.string().c_str(), O_RDWR | O_CREAT | O_TRUNC, 0664);
|
||||
if (fd == -1)
|
||||
|
@ -68,7 +68,7 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename)
|
|||
Log(EError, "The file \"%s\" does not exist!", filename.string().c_str());
|
||||
d->size = (size_t) fs::file_size(filename);
|
||||
Log(ETrace, "Mapping \"%s\" into memory (%s)..",
|
||||
filename.filename().c_str(), memString(d->size).c_str());
|
||||
filename.filename().string().c_str(), memString(d->size).c_str());
|
||||
#if defined(__LINUX__) || defined(__OSX__)
|
||||
int fd = open(filename.string().c_str(), O_RDONLY);
|
||||
if (fd == -1)
|
||||
|
|
|
@ -544,7 +544,7 @@ InterpolatedSpectrum::InterpolatedSpectrum(const fs::path &path) {
|
|||
path.string().c_str());
|
||||
|
||||
SLog(EInfo, "\"%s\": loaded a spectral power distribution with " SIZE_T_FMT
|
||||
" entries (between %f and %f nm)", path.filename().c_str(), m_wavelengths.size(),
|
||||
" entries (between %f and %f nm)", path.filename().string().c_str(), m_wavelengths.size(),
|
||||
m_wavelengths[0], m_wavelengths[m_wavelengths.size()-1]);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,20 +96,20 @@ void RenderJob::run() {
|
|||
if (!m_scene->preprocess(m_queue, this, m_sceneResID, m_sensorResID, m_samplerResID)) {
|
||||
m_cancelled = true;
|
||||
Log(EWarn, "Preprocessing of scene \"%s\" did not complete successfully!",
|
||||
m_scene->getSourceFile().filename().c_str());
|
||||
m_scene->getSourceFile().filename().string().c_str());
|
||||
}
|
||||
|
||||
if (!m_cancelled) {
|
||||
if (!m_scene->render(m_queue, this, m_sceneResID, m_sensorResID, m_samplerResID)) {
|
||||
m_cancelled = true;
|
||||
Log(EWarn, "Rendering of scene \"%s\" did not complete successfully!",
|
||||
m_scene->getSourceFile().filename().c_str());
|
||||
m_scene->getSourceFile().filename().string().c_str());
|
||||
}
|
||||
m_scene->postprocess(m_queue, this, m_sceneResID, m_sensorResID, m_samplerResID);
|
||||
}
|
||||
} catch (const std::exception &ex) {
|
||||
Log(EWarn, "Rendering of scene \"%s\" did not complete successfully, caught exception: %s",
|
||||
m_scene->getSourceFile().filename().c_str(), ex.what());
|
||||
m_scene->getSourceFile().filename().string().c_str(), ex.what());
|
||||
m_cancelled = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -581,7 +581,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) {
|
|||
parser->setCalculateSrcOfs(true);
|
||||
#endif
|
||||
fs::path path = resolver->resolve(context.attributes["filename"]);
|
||||
XMLLog(EInfo, "Parsing included file \"%s\" ..", path.filename().c_str());
|
||||
XMLLog(EInfo, "Parsing included file \"%s\" ..", path.filename().string().c_str());
|
||||
parser->parse(path.string().c_str());
|
||||
|
||||
object = handler->getScene();
|
||||
|
|
|
@ -77,7 +77,7 @@ UpgradeManager::UpgradeManager(const FileResolver *resolver) : m_resolver(resolv
|
|||
|
||||
for (size_t i=0; i<m_transformations.size(); ++i)
|
||||
SLog(EInfo, " - registered transformation \"%s\", which updates to version %s",
|
||||
m_transformations[i].second.filename().c_str(),
|
||||
m_transformations[i].second.filename().string().c_str(),
|
||||
m_transformations[i].first.toString().c_str());
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ void UpgradeManager::performUpgrade(const QString &filename, const Version &vers
|
|||
outputBuffer.open(QIODevice::WriteOnly | QIODevice::Truncate);
|
||||
|
||||
SLog(EInfo, "Applying transformation \"%s\" ..",
|
||||
m_transformations[i].second.filename().c_str());
|
||||
m_transformations[i].second.filename().string().c_str());
|
||||
std::string trafoFilename = m_transformations[i].second.string();
|
||||
QFile trafoFile(trafoFilename.c_str());
|
||||
if (!trafoFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
|
|
|
@ -631,7 +631,7 @@ HairShape::HairShape(const Properties &props) : Shape(props) {
|
|||
Transform objectToWorld = props.getTransform("toWorld", Transform());
|
||||
radius *= objectToWorld(Vector(0, 0, 1)).length();
|
||||
|
||||
Log(EInfo, "Loading hair geometry from \"%s\" ..", path.filename().c_str());
|
||||
Log(EInfo, "Loading hair geometry from \"%s\" ..", path.filename().string().c_str());
|
||||
ref<Timer> timer = new Timer();
|
||||
|
||||
ref<FileStream> binaryStream = new FileStream(path, FileStream::EReadOnly);
|
||||
|
|
|
@ -204,7 +204,7 @@ public:
|
|||
Transform objectToWorld = props.getTransform("toWorld", Transform());
|
||||
|
||||
/* Load the geometry */
|
||||
Log(EInfo, "Loading geometry from \"%s\" ..", path.filename().c_str());
|
||||
Log(EInfo, "Loading geometry from \"%s\" ..", path.filename().string().c_str());
|
||||
fs::ifstream is(path);
|
||||
if (is.bad() || is.fail())
|
||||
Log(EError, "Wavefront OBJ file '%s' not found!", path.string().c_str());
|
||||
|
@ -329,7 +329,7 @@ public:
|
|||
if (!materialLibrary.empty())
|
||||
loadMaterialLibrary(fileResolver, materialLibrary);
|
||||
|
||||
Log(EInfo, "Done with \"%s\" (took %i ms)", path.filename().c_str(), timer->getMilliseconds());
|
||||
Log(EInfo, "Done with \"%s\" (took %i ms)", path.filename().string().c_str(), timer->getMilliseconds());
|
||||
}
|
||||
|
||||
WavefrontOBJ(Stream *stream, InstanceManager *manager) : Shape(stream, manager) {
|
||||
|
@ -401,7 +401,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
Log(EInfo, "Loading OBJ materials from \"%s\" ..", mtlPath.filename().c_str());
|
||||
Log(EInfo, "Loading OBJ materials from \"%s\" ..", mtlPath.filename().string().c_str());
|
||||
fs::ifstream is(mtlPath);
|
||||
if (is.bad() || is.fail())
|
||||
Log(EError, "Unexpected I/O error while accessing material file '%s'!",
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
m_objectToWorld = props.getTransform("toWorld", Transform());
|
||||
|
||||
/* Load the geometry */
|
||||
Log(EInfo, "Loading geometry from \"%s\" ..", filePath.filename().c_str());
|
||||
Log(EInfo, "Loading geometry from \"%s\" ..", filePath.filename().string().c_str());
|
||||
if (!fs::exists(filePath))
|
||||
Log(EError, "PLY file \"%s\" could not be found!", filePath.c_str());
|
||||
|
||||
|
|
|
@ -148,10 +148,10 @@ public:
|
|||
int shapeIndex = props.getInteger("shapeIndex", 0);
|
||||
|
||||
m_name = (props.getID() != "unnamed") ? props.getID()
|
||||
: formatString("%s@%i", filePath.stem().c_str(), shapeIndex);
|
||||
: formatString("%s@%i", filePath.stem().string().c_str(), shapeIndex);
|
||||
|
||||
/* Load the geometry */
|
||||
Log(EInfo, "Loading shape %i from \"%s\" ..", shapeIndex, filePath.filename().c_str());
|
||||
Log(EInfo, "Loading shape %i from \"%s\" ..", shapeIndex, filePath.filename().string().c_str());
|
||||
ref<FileStream> stream = new FileStream(filePath, FileStream::EReadOnly);
|
||||
ref<Timer> timer = new Timer();
|
||||
loadCompressed(stream, shapeIndex);
|
||||
|
|
|
@ -184,7 +184,7 @@ public:
|
|||
m_filename = Thread::getThread()->getFileResolver()->resolve(
|
||||
props.getString("filename"));
|
||||
|
||||
Log(EInfo, "Loading texture \"%s\"", m_filename.filename().c_str());
|
||||
Log(EInfo, "Loading texture \"%s\"", m_filename.filename().string().c_str());
|
||||
if (!fs::exists(m_filename))
|
||||
Log(EError, "Texture file \"%s\" could not be found!", m_filename.c_str());
|
||||
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
bitmap = new Bitmap(Bitmap::EAuto, fs);
|
||||
if (m_gamma != 0)
|
||||
bitmap->setGamma(m_gamma);
|
||||
Log(EDebug, "Loaded \"%s\" in %i ms", m_filename.filename().c_str(),
|
||||
Log(EDebug, "Loaded \"%s\" in %i ms", m_filename.filename().string().c_str(),
|
||||
timer->getMilliseconds());
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ public:
|
|||
BitmapTexture(Stream *stream, InstanceManager *manager)
|
||||
: Texture2D(stream, manager) {
|
||||
m_filename = stream->readString();
|
||||
Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().c_str());
|
||||
Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().string().c_str());
|
||||
m_filterType = (EMIPFilterType) stream->readUInt();
|
||||
m_wrapModeU = (ReconstructionFilter::EBoundaryCondition) stream->readUInt();
|
||||
m_wrapModeV = (ReconstructionFilter::EBoundaryCondition) stream->readUInt();
|
||||
|
|
|
@ -281,7 +281,7 @@ public:
|
|||
}
|
||||
|
||||
Log(EDebug, "Mapped \"%s\" into memory: %ix%ix%i (%i channels, format = %s), %s, %s",
|
||||
resolved.filename().c_str(), m_res.x, m_res.y, m_res.z, m_channels, format.c_str(),
|
||||
resolved.filename().string().c_str(), m_res.x, m_res.y, m_res.z, m_channels, format.c_str(),
|
||||
memString(m_mmap->getSize()).c_str(), m_dataAABB.toString().c_str());
|
||||
m_data = (uint8_t *) (((float *) m_mmap->getData()) + 12);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue