1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
10 #include <ModelAPI_Feature.h>
11 #include <ModuleBase_Definitions.h>
17 \brief Return directory part of the file path.
19 If the file path does not include directory part (the file is in the
20 current directory), null string is returned.
23 \param abs if true (default) \a path parameter is treated as absolute file path
24 \return directory part of the file path
26 namespace XGUI_Tools {
29 * Returns directory name from name of file
30 * \param path a path to a file
31 * \param isAbs is absolute or relative path
33 QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
36 \brief Return file name part of the file path.
39 \param withExt if true (default) complete file name (with all
40 extension except the last) is returned, otherwise only base name
42 \return file name part of the file path
44 QString XGUI_EXPORT file(const QString& path, bool withExt = true);
47 \brief Add a slash (platform-specific) to the end of \a path
48 if it is not already there.
49 \param path directory path
50 \return modified path (with slash added to the end)
52 QString XGUI_EXPORT addSlash(const QString& path);
54 /// The model concerning tools
57 Returns true if the feature is a model object
58 \param theFeature a feature
60 bool XGUI_EXPORT isModelObject(FeaturePtr theFeature);
63 Returns the string presentation of the given feature
64 \param theFeature a feature
66 std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
70 Check types of objects which are in the given list
71 \param theObjects the list of objects
72 \param hasResult will be set to true if list contains Result objects
73 \param hasFeature will be set to true if list contains Feature objects
74 \param hasParameter will be set to true if list contains Parameter objects
76 void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature, bool& hasParameter);