1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
10 #include <ModelAPI_Feature.h>
12 #include <ModuleBase_Definitions.h>
20 \brief Return directory part of the file path.
22 If the file path does not include directory part (the file is in the
23 current directory), null string is returned.
26 \param abs if true (default) \a path parameter is treated as absolute file path
27 \return directory part of the file path
29 namespace XGUI_Tools {
32 * Returns directory name from name of file
33 * \param path a path to a file
34 * \param isAbs is absolute or relative path
36 QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
39 \brief Return file name part of the file path.
42 \param withExt if true (default) complete file name (with all
43 extension except the last) is returned, otherwise only base name
45 \return file name part of the file path
47 QString XGUI_EXPORT file(const QString& path, bool withExt = true);
50 \brief Add a slash (platform-specific) to the end of \a path
51 if it is not already there.
52 \param path directory path
53 \return modified path (with slash added to the end)
55 QString XGUI_EXPORT addSlash(const QString& path);
57 /// The model concerning tools
60 Returns true if the feature is a model object
61 \param theFeature a feature
63 bool XGUI_EXPORT isModelObject(FeaturePtr theFeature);
66 Returns the string presentation of the given feature
67 \param theFeature a feature
69 std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
72 Returns true if there are no parts in the document, which are not activated or
73 all objects in the list are not PartSet document.
74 It shows the warning control if the result is false.
75 \param theParent a parent for the warning control
76 \param theList a list of object
77 \return a boolean value
79 bool XGUI_EXPORT canRemoveOrRename(QWidget* theParent, const QObjectPtrList& aList);
82 Returns true if there are no parts in the document, which are not activated
83 \return a boolean value
85 bool XGUI_EXPORT allDocumentsActivated(QString& theNotActivatedNames);