Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / XGUI / XGUI_Tools.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #ifndef XGUI_Tools_H
4 #define XGUI_Tools_H
5
6 #include "XGUI.h"
7 #include <QString>
8 #include <QRect>
9
10 #include <ModelAPI_Feature.h>
11
12 #include <memory>
13
14 /*!
15  \brief Return directory part of the file path.
16
17  If the file path does not include directory part (the file is in the
18  current directory), null string is returned.
19
20  \param path file path
21  \param abs if true (default) \a path parameter is treated as absolute file path
22  \return directory part of the file path
23  */
24 namespace XGUI_Tools {
25 QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
26
27 /*!
28  \brief Return file name part of the file path.
29
30  \param path file path
31  \param withExt if true (default) complete file name (with all
32  extension except the last) is returned, otherwise only base name
33  is returned
34  \return file name part of the file path
35  */
36 QString XGUI_EXPORT file(const QString& path, bool withExt = true);
37
38 /*!
39  \brief Add a slash (platform-specific) to the end of \a path
40  if it is not already there.
41  \param path directory path
42  \return modified path (with slash added to the end)
43  */
44 QString XGUI_EXPORT addSlash(const QString& path);
45
46 /// The model concerning tools
47
48 /*!
49  Returns true if the feature is a model object
50  \param theFeature a feature
51  */
52 bool XGUI_EXPORT isModelObject(FeaturePtr theFeature);
53
54 /*!
55  Returns the string presentation of the given feature
56  \param theFeature a feature
57  */
58 std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
59 }
60
61 #endif