-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using filesystem path 2 [ANT-1999] #2454
Conversation
…torTeam/Antares_Simulator into feature/use-std-fs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job !
Please change the following
loadFromFolder(const std::string&, ...)
=>loadFromFolder(const std::filesystem::path&, ...)
- same for
saveToFolder
? - same for
addFromBuffer
- You may use attribute
[[deprecated]]
template<class StringT> | ||
size_t sizeOnDisk(const StringT& sourceFolder) const | ||
{ | ||
if (item.empty()) | ||
{ | ||
return 0; | ||
} | ||
pTmp = sourceFolder; | ||
return (!pTmp) ? 0 : internalSizeOnDisk(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to other readers: this function is unused
size_t PathList::internalSizeOnDisk() const | ||
{ | ||
size_t size = 0; | ||
Clob buffer; | ||
|
||
const ItemList::const_iterator end = item.end(); | ||
for (ItemList::const_iterator i = item.begin(); i != end; ++i) | ||
{ | ||
if (!(i->second.options & pathListOptFolder)) | ||
{ | ||
buffer.clear() << pTmp << SEP << i->first; | ||
size += (size_t)IO::File::Size(pTmp); | ||
} | ||
} | ||
return size; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this function is unused.
src/libs/antares/study/include/antares/study/parts/solar/prepro.h
Outdated
Show resolved
Hide resolved
@@ -254,7 +251,7 @@ void List<NextT>::buildSurveyReport(SurveyResults& results, | |||
|
|||
// The new filename | |||
results.data.filename.clear(); | |||
results.data.filename << results.data.output << SEP; | |||
results.data.filename << std::filesystem::path(std::string(results.data.output)) / ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ugly...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but it avoids intermediate variables needed to convert from yuni string
path /= std::filesystem::path("areas") / area.id.to<std::string>() / "thermal" | ||
/ cluster->id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a typedef
, you can just use
path /= std::filesystem::path("areas") / area.id.to<std::string>() / "thermal" | |
/ cluster->id(); | |
path /= fs("areas") / area.id.to<std::string>() / "thermal" | |
/ cluster->id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a hxx file, i don't use typedef
Quality Gate passedIssues Measures |
following #2435