mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-23 01:25:20 -04:00
[API Break] Fix pathTools (and a bit stringTools).
Api changes : - removeLastPathElement do not takes extra arguments `removePreSeparator` and `removePostSeparator`. This is not needed as path do not need special tailing separator. - Only one function `split`. Arguments can be implicitly convert to string. No need for overloading functions to explicitly cast them. - `split` function takes another argument `trimEmpty`. If true, empty element are removed. Path manipulation now almost pass trough a vector<string> to store each path's part. Most of the complex works is now made in the normalizeParts function.
This commit is contained in:
1 parent
49c0c5ff47
commit
598dd3c175
11 files changed
+344
-116
No files matched your search
+1
-1
@@ -115,7 +115,7 @@ unsigned int Library::getBookCount(const bool localBooks,
|
||||
|
||||
bool Library::writeToFile(const std::string& path)
|
||||
{
|
||||
auto baseDir = removeLastPathElement(path, true, false);
|
||||
auto baseDir = removeLastPathElement(path);
|
||||
LibXMLDumper dumper(this);
|
||||
dumper.setBaseDir(baseDir);
|
||||
return writeTextFile(path, dumper.dumpLibXMLContent(getBooksIds()));
|
||||
|
||||
Reference in new issue
Block a user