aboutsummaryrefslogtreecommitdiff
path: root/depends/util/include
diff options
context:
space:
mode:
Diffstat (limited to 'depends/util/include')
-rw-r--r--depends/util/include/cmdutils.h9
-rw-r--r--depends/util/include/pathutils.h10
2 files changed, 12 insertions, 7 deletions
diff --git a/depends/util/include/cmdutils.h b/depends/util/include/cmdutils.h
index 93fef9ff..bab5a9fa 100644
--- a/depends/util/include/cmdutils.h
+++ b/depends/util/include/cmdutils.h
@@ -19,6 +19,7 @@
#define CMDUTILS_H
#include <exception>
+#include <stdexcept>
#include <QString>
#include <QVariant>
@@ -83,16 +84,10 @@ enum Enum
/**
* @brief The ParsingError class
*/
-class LIBUTIL_EXPORT ParsingError : public std::exception
+class LIBUTIL_EXPORT ParsingError : public std::runtime_error
{
public:
ParsingError(const QString &what);
- ParsingError(const ParsingError &e);
- ~ParsingError() throw() {}
- const char *what() const throw();
- QString qwhat() const;
-private:
- QString m_what;
};
/**
diff --git a/depends/util/include/pathutils.h b/depends/util/include/pathutils.h
index cea3a39a..c892c115 100644
--- a/depends/util/include/pathutils.h
+++ b/depends/util/include/pathutils.h
@@ -25,6 +25,16 @@ LIBUTIL_EXPORT QString PathCombine(QString path1, QString path2, QString path3);
LIBUTIL_EXPORT QString AbsolutePath(QString path);
+/**
+ * Normalize path
+ *
+ * Any paths inside the current directory will be normalized to relative paths (to current)
+ * Other paths will be made absolute
+ *
+ * Returns false if the path logic somehow filed (and normalizedPath in invalid)
+ */
+QString NormalizePath(QString path);
+
LIBUTIL_EXPORT QString RemoveInvalidFilenameChars(QString string, QChar replaceWith = '-');
LIBUTIL_EXPORT QString DirNameFromString(QString string, QString inDir = ".");