Update ooo320-m1
[ooovba.git] / configmgr / source / localbe / localfilehelper.hxx
blobf0421509338b78e02bfa2d116bfe96992de0d2b2
1 #ifndef CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
2 #define CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
4 #include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
5 #include <com/sun/star/configuration/backend/CannotConnectException.hpp>
6 #include <com/sun/star/configuration/backend/BackendAccessException.hpp>
7 #include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
8 #include <com/sun/star/uno/Sequence.hxx>
9 #include <osl/file.hxx>
12 namespace configmgr
15 namespace localbe
17 namespace css = com::sun::star ;
18 namespace uno = css::uno ;
19 namespace backend = css::configuration::backend ;
21 /**
22 Validates a file URL
24 @param _sFileURL URL of the file to validate
25 @return bool true if URL valid, false if URL invalid
28 bool isValidFileURL (rtl::OUString const& _sFileURL);
29 /**
30 Ensures Absolute URL
31 @param _sFileURL URL of the file to validate
32 @return bool true if URL is absolute URL,
33 false if URL is not absolute URL
36 bool implEnsureAbsoluteURL(rtl::OUString & _sFileURL);
37 /**
38 Normalize URL
39 @param _sFileURL URL of the file to validate
40 @param aDirItem Directory Item
41 @return RC error code
44 osl::DirectoryItem::RC implNormalizeURL(rtl::OUString & _sFileURL, osl::DirectoryItem& aDirItem);
45 /**
46 Normalize URL
47 @param _sFileURL URL of the file to validate
48 @param pContext pointer to context class
49 @param bNothrow param indicating that exception should not be thrown
50 @return bool true if URL is normalized URL
51 false if URL is not normalized URL
55 bool normalizeURL(rtl::OUString & _sFileURL,
56 const uno::Reference<uno::XInterface>& pContext,
57 bool bNothrow = false )
58 throw (backend::InsufficientAccessRightsException,
59 backend::BackendAccessException);
61 /**
62 Validates a file URL
64 @param _sFileURL URL of the file to validate
65 @param pContext pointer to context class
66 @throws css::configuration::InvalidBootstrapFileException
68 void validateFileURL(const rtl::OUString& _sFileURL,
69 const uno::Reference<uno::XInterface>& pContext)
70 throw(css::configuration::InvalidBootstrapFileException);
71 /**
72 Checks if a Directory exist for a given file URL
74 @param _sFileURL URL of the file to validate
75 @param pContext pointer to context class
76 @throws backend::BackendSetupException
78 void checkIfDirectory(const rtl::OUString& _sFileURL,
79 const uno::Reference<uno::XInterface>& pContext )
80 throw (backend::BackendSetupException);
81 /**
82 Checks if a File exist for a given file URL
83 @param pContext pointer to context class
84 @param _sFileURL URL of the file to validate
85 @throws backend::CannotConnectException
87 void checkFileExists(const rtl::OUString& _sFileURL,
88 const uno::Reference<uno::XInterface>& pContext)
89 throw (backend::CannotConnectException);
91 /**
92 Convert Component name to Path name
93 @param aComponent Component name
95 rtl::OUString componentToPath(const rtl::OUString& aComponent);
97 /// character that can be used to delimit a sub-id within a layerid
98 const sal_Unicode k_cLayerIdSeparator = ':';
99 /**
100 Convert layer id to Path name
101 Format of layer id is <component> [:<sub-id>]
102 @param aLayerId layer id
104 rtl::OUString layeridToPath(const rtl::OUString& aLayerId);
108 Checks if Arguement is Optional
109 @param aArg Argument
110 @return bool returns true is Argument is Optional, false otherwise
112 bool checkOptionalArg(rtl::OUString& aArg);
115 parses sequence of strings from blank separated list
116 @param aList blank separated list
117 @param aTarget sequence of parsed strings
119 void fillFromBlankSeparated(const rtl::OUString& aList,
120 uno::Sequence<rtl::OUString>& aTarget);
124 #endif