1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #if ! defined INCLUDED_DP_UCB_H
25 #define INCLUDED_DP_UCB_H
26 
27 #include <list>
28 #include "rtl/byteseq.hxx"
29 #include "rtl/instance.hxx"
30 #include "com/sun/star/ucb/XCommandEnvironment.hpp"
31 #include "dp_misc_api.hxx"
32 
33 namespace ucbhelper
34 {
35 class Content;
36 }
37 
38 namespace css = ::com::sun::star;
39 
40 namespace dp_misc {
41 
42 struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle :
43     public rtl::StaticWithInit<const rtl::OUString, StrTitle>
44 {
45     const rtl::OUString operator () ();
46 };
47 
48 //==============================================================================
49 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(
50     ::ucbhelper::Content * ucb_content,
51     ::rtl::OUString const & url,
52     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
53     bool throw_exc = true );
54 
55 //==============================================================================
56 /** @return true if previously non-existing folder has been created
57  */
58 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(
59     ::ucbhelper::Content * ucb_content,
60     ::rtl::OUString const & url,
61     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
62     bool throw_exc = true );
63 
64 //==============================================================================
65 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(
66     ::rtl::OUString const & url,
67     css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
68     bool throw_exc = true );
69 
70 //==============================================================================
71 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
72 ::rtl::ByteSequence readFile( ::ucbhelper::Content & ucb_content );
73 
74 //==============================================================================
75 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
76 bool readLine( ::rtl::OUString * res, ::rtl::OUString const & startingWith,
77                ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
78 
79 DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
80 bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString> > & out_result,
81                 ::ucbhelper::Content & ucb_content);
82 
83 
84 
85 }
86 
87 #endif
88