1 | <?xml version='1.0' encoding='UTF-8' standalone='no'?> |
---|
2 | <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6"> |
---|
3 | <compounddef id="osutils_8cpp" kind="file"> |
---|
4 | <compoundname>osutils.cpp</compoundname> |
---|
5 | <includes refid="osutils_8h" local="yes">osutils.h</includes> |
---|
6 | <includes local="no">iostream</includes> |
---|
7 | <includes local="no">sys/types.h</includes> |
---|
8 | <includes local="no">sys/stat.h</includes> |
---|
9 | <includes local="no">fcntl.h</includes> |
---|
10 | <includes local="no">errno.h</includes> |
---|
11 | <incdepgraph> |
---|
12 | <node id="326"> |
---|
13 | <label>sys/stat.h</label> |
---|
14 | </node> |
---|
15 | <node id="328"> |
---|
16 | <label>errno.h</label> |
---|
17 | </node> |
---|
18 | <node id="327"> |
---|
19 | <label>fcntl.h</label> |
---|
20 | </node> |
---|
21 | <node id="325"> |
---|
22 | <label>sys/types.h</label> |
---|
23 | </node> |
---|
24 | <node id="324"> |
---|
25 | <label>iostream</label> |
---|
26 | </node> |
---|
27 | <node id="323"> |
---|
28 | <label>itpp/itbase.h</label> |
---|
29 | </node> |
---|
30 | <node id="322"> |
---|
31 | <label>osutils.h</label> |
---|
32 | <link refid="osutils_8h-source"/> |
---|
33 | <childnode refid="323" relation="include"> |
---|
34 | </childnode> |
---|
35 | </node> |
---|
36 | <node id="321"> |
---|
37 | <label>work/git/mixpp/bdm/osutils.cpp</label> |
---|
38 | <link refid="osutils.cpp"/> |
---|
39 | <childnode refid="322" relation="include"> |
---|
40 | </childnode> |
---|
41 | <childnode refid="324" relation="include"> |
---|
42 | </childnode> |
---|
43 | <childnode refid="325" relation="include"> |
---|
44 | </childnode> |
---|
45 | <childnode refid="326" relation="include"> |
---|
46 | </childnode> |
---|
47 | <childnode refid="327" relation="include"> |
---|
48 | </childnode> |
---|
49 | <childnode refid="328" relation="include"> |
---|
50 | </childnode> |
---|
51 | </node> |
---|
52 | </incdepgraph> |
---|
53 | <sectiondef kind="func"> |
---|
54 | <memberdef kind="function" id="osutils_8cpp_10f82aae3b9f165f2694d2326d8ecd311" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
55 | <type>void</type> |
---|
56 | <definition>void get_fname</definition> |
---|
57 | <argsstring>(char *filename, string &dirname, string &f)</argsstring> |
---|
58 | <name>get_fname</name> |
---|
59 | <param> |
---|
60 | <type>char *</type> |
---|
61 | <declname>filename</declname> |
---|
62 | </param> |
---|
63 | <param> |
---|
64 | <type>string &</type> |
---|
65 | <declname>dirname</declname> |
---|
66 | </param> |
---|
67 | <param> |
---|
68 | <type>string &</type> |
---|
69 | <declname>f</declname> |
---|
70 | </param> |
---|
71 | <briefdescription> |
---|
72 | </briefdescription> |
---|
73 | <detaileddescription> |
---|
74 | </detaileddescription> |
---|
75 | <inbodydescription> |
---|
76 | </inbodydescription> |
---|
77 | <location file="/home/smidl/work/git/mixpp/bdm/osutils.cpp" line="27" bodyfile="/home/smidl/work/git/mixpp/bdm/osutils.cpp" bodystart="27" bodyend="33"/> |
---|
78 | </memberdef> |
---|
79 | <memberdef kind="function" id="osutils_8cpp_1527d5b931624a8b8646477229dd30c82" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> |
---|
80 | <type>void</type> |
---|
81 | <definition>void makedir</definition> |
---|
82 | <argsstring>(string &dirname, bool rewrite)</argsstring> |
---|
83 | <name>makedir</name> |
---|
84 | <param> |
---|
85 | <type>string &</type> |
---|
86 | <declname>dirname</declname> |
---|
87 | </param> |
---|
88 | <param> |
---|
89 | <type>bool</type> |
---|
90 | <declname>rewrite</declname> |
---|
91 | <defval>true</defval> |
---|
92 | </param> |
---|
93 | <briefdescription> |
---|
94 | <para>Function creates a directory and raises it_error if it is not possible. </para> </briefdescription> |
---|
95 | <detaileddescription> |
---|
96 | <para><parameterlist kind="param"><parameteritem> |
---|
97 | <parameternamelist> |
---|
98 | <parametername>dirname</parametername> |
---|
99 | </parameternamelist> |
---|
100 | <parameterdescription> |
---|
101 | <para>name of the directory to be created </para></parameterdescription> |
---|
102 | </parameteritem> |
---|
103 | <parameteritem> |
---|
104 | <parameternamelist> |
---|
105 | <parametername>rewrite</parametername> |
---|
106 | </parameternamelist> |
---|
107 | <parameterdescription> |
---|
108 | <para>if true then existence of the directory is not an error </para></parameterdescription> |
---|
109 | </parameteritem> |
---|
110 | </parameterlist> |
---|
111 | </para> </detaileddescription> |
---|
112 | <inbodydescription> |
---|
113 | </inbodydescription> |
---|
114 | <location file="/home/smidl/work/git/mixpp/bdm/osutils.cpp" line="35" bodyfile="/home/smidl/work/git/mixpp/bdm/osutils.cpp" bodystart="35" bodyend="45"/> |
---|
115 | </memberdef> |
---|
116 | </sectiondef> |
---|
117 | <briefdescription> |
---|
118 | </briefdescription> |
---|
119 | <detaileddescription> |
---|
120 | </detaileddescription> |
---|
121 | <programlisting> |
---|
122 | <codeline lineno="1"><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
123 | <codeline lineno="2"><highlight class="normal"></highlight><highlight class="comment">//<sp/>C++<sp/>Implementation:<sp/>osutils</highlight><highlight class="normal"></highlight></codeline> |
---|
124 | <codeline lineno="3"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
125 | <codeline lineno="4"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Description:</highlight><highlight class="normal"></highlight></codeline> |
---|
126 | <codeline lineno="5"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
127 | <codeline lineno="6"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
128 | <codeline lineno="7"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Author:<sp/>smidl<sp/><smidl@utia.cas.cz>,<sp/>(C)<sp/>2008</highlight><highlight class="normal"></highlight></codeline> |
---|
129 | <codeline lineno="8"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
130 | <codeline lineno="9"><highlight class="normal"></highlight><highlight class="comment">//<sp/>Copyright:<sp/>See<sp/>COPYING<sp/>file<sp/>that<sp/>comes<sp/>with<sp/>this<sp/>distribution</highlight><highlight class="normal"></highlight></codeline> |
---|
131 | <codeline lineno="10"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
132 | <codeline lineno="11"><highlight class="normal"></highlight><highlight class="comment">//</highlight><highlight class="normal"></highlight></codeline> |
---|
133 | <codeline lineno="12"><highlight class="normal"></highlight></codeline> |
---|
134 | <codeline lineno="13"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>"osutils.h"</highlight><highlight class="normal"></highlight></codeline> |
---|
135 | <codeline lineno="14"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><iostream></highlight><highlight class="normal"></highlight></codeline> |
---|
136 | <codeline lineno="15"><highlight class="normal"></highlight></codeline> |
---|
137 | <codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>WIN32</highlight></codeline> |
---|
138 | <codeline lineno="17"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#include<sp/><direct.h></highlight><highlight class="normal"></highlight></codeline> |
---|
139 | <codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight></codeline> |
---|
140 | <codeline lineno="19"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#include<sp/><sys/types.h></highlight><highlight class="normal"></highlight></codeline> |
---|
141 | <codeline lineno="20"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><sys/stat.h></highlight><highlight class="normal"></highlight></codeline> |
---|
142 | <codeline lineno="21"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline> |
---|
143 | <codeline lineno="22"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline> |
---|
144 | <codeline lineno="23"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><fcntl.h></highlight><highlight class="normal"></highlight></codeline> |
---|
145 | <codeline lineno="24"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><errno.h></highlight><highlight class="normal"></highlight></codeline> |
---|
146 | <codeline lineno="25"><highlight class="normal"></highlight></codeline> |
---|
147 | <codeline lineno="26"><highlight class="normal"></highlight></codeline> |
---|
148 | <codeline lineno="27"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>get_fname<sp/>(<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal">*<sp/>filename,<sp/></highlight><highlight class="keywordtype">string</highlight><highlight class="normal"><sp/>&dirname,<sp/></highlight><highlight class="keywordtype">string</highlight><highlight class="normal"><sp/>&f<sp/>)<sp/>{</highlight></codeline> |
---|
149 | <codeline lineno="28"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>WIN32</highlight></codeline> |
---|
150 | <codeline lineno="29"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sprintf<sp/>(<sp/>filename,</highlight><highlight class="stringliteral">"%s\\%s"</highlight><highlight class="normal">,dirname.c_str(),f.c_str()<sp/>);</highlight></codeline> |
---|
151 | <codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight></codeline> |
---|
152 | <codeline lineno="31"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>sprintf<sp/>(<sp/>filename,</highlight><highlight class="stringliteral">"%s/%s"</highlight><highlight class="normal">,dirname.c_str()<sp/>,f.c_str()<sp/>);</highlight></codeline> |
---|
153 | <codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline> |
---|
154 | <codeline lineno="33"><highlight class="preprocessor"></highlight><highlight class="normal">}</highlight></codeline> |
---|
155 | <codeline lineno="34"><highlight class="normal"></highlight></codeline> |
---|
156 | <codeline lineno="35"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>makedir(</highlight><highlight class="keywordtype">string</highlight><highlight class="normal"><sp/>&dirname,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>rewrite){</highlight></codeline> |
---|
157 | <codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#ifdef<sp/>WIN32</highlight></codeline> |
---|
158 | <codeline lineno="37"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(mkdir(dirname.c_str())<sp/>==<sp/>-1)<sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>the<sp/>directory</highlight><highlight class="normal"></highlight></codeline> |
---|
159 | <codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight></codeline> |
---|
160 | <codeline lineno="39"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(mkdir(dirname.c_str(),<sp/>00755)<sp/>==<sp/>-1)<sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>Create<sp/>the<sp/>directory</highlight><highlight class="normal"></highlight></codeline> |
---|
161 | <codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline> |
---|
162 | <codeline lineno="41"><highlight class="preprocessor"></highlight><highlight class="normal">{</highlight></codeline> |
---|
163 | <codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((rewrite)<sp/>&&<sp/>(<sp/>errno==EEXIST<sp/>)<sp/>)<sp/>it_warning<sp/>(<sp/></highlight><highlight class="stringliteral">"rewriting<sp/>directory"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
164 | <codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>it_error<sp/>(<sp/></highlight><highlight class="stringliteral">"dirfilelog::<sp/>cannot<sp/>create<sp/>directory"</highlight><highlight class="normal"><sp/>);</highlight></codeline> |
---|
165 | <codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/>}</highlight></codeline> |
---|
166 | <codeline lineno="45"><highlight class="normal">}</highlight></codeline> |
---|
167 | </programlisting> |
---|
168 | <location file="/home/smidl/work/git/mixpp/bdm/osutils.cpp"/> |
---|
169 | </compounddef> |
---|
170 | </doxygen> |
---|