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