aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fstringtest.dev59
-rw-r--r--libbu++.dev209
-rw-r--r--src/file.cpp10
-rw-r--r--src/file.h2
-rw-r--r--src/tests/fstring.cpp10
5 files changed, 286 insertions, 4 deletions
diff --git a/fstringtest.dev b/fstringtest.dev
new file mode 100644
index 0000000..297242d
--- /dev/null
+++ b/fstringtest.dev
@@ -0,0 +1,59 @@
1[Project]
2FileName=fstringtest.dev
3Name=fstringtest
4UnitCount=1
5Type=1
6Ver=1
7ObjFiles=
8Includes=z:\home\neonphog\wine_documents\libbu++\src\bu
9Libs=
10PrivateResource=
11ResourceIncludes=
12MakeIncludes=
13Compiler=
14CppCompiler=_@@_
15Linker=libbu++.a_@@_
16IsCpp=1
17Icon=
18ExeOutput=
19ObjectOutput=
20OverrideOutput=0
21OverrideOutputName=fstringtest.exe
22HostApplication=
23Folders=
24CommandLine=
25UseCustomMakefile=0
26CustomMakefile=
27IncludeVersionInfo=0
28SupportXPThemes=0
29CompilerSet=0
30CompilerSettings=0000000000000000000000
31
32[VersionInfo]
33Major=0
34Minor=1
35Release=1
36Build=1
37LanguageID=1033
38CharsetID=1252
39CompanyName=
40FileVersion=
41FileDescription=Developed using the Dev-C++ IDE
42InternalName=
43LegalCopyright=
44LegalTrademarks=
45OriginalFilename=
46ProductName=
47ProductVersion=
48AutoIncBuildNr=0
49
50[Unit1]
51FileName=src\tests\fstring.cpp
52CompileCpp=1
53Folder=fstringtest
54Compile=1
55Link=1
56Priority=1000
57OverrideBuildCmd=0
58BuildCmd=
59
diff --git a/libbu++.dev b/libbu++.dev
new file mode 100644
index 0000000..2fb1ae9
--- /dev/null
+++ b/libbu++.dev
@@ -0,0 +1,209 @@
1[Project]
2FileName=libbu++.dev
3Name=libbu++
4UnitCount=16
5Type=2
6Ver=1
7ObjFiles=
8Includes=z:\home\neonphog\wine_documents\libbu++\src\bu
9Libs=
10PrivateResource=
11ResourceIncludes=
12MakeIncludes=
13Compiler=
14CppCompiler=
15Linker=
16IsCpp=1
17Icon=
18ExeOutput=
19ObjectOutput=
20OverrideOutput=0
21OverrideOutputName=libbu++.a
22HostApplication=
23Folders=
24CommandLine=
25UseCustomMakefile=0
26CustomMakefile=
27IncludeVersionInfo=0
28SupportXPThemes=0
29CompilerSet=0
30CompilerSettings=0000000000000000000000
31
32[Unit1]
33FileName=src\stream.cpp
34CompileCpp=1
35Folder=libbu++
36Compile=1
37Link=1
38Priority=1000
39OverrideBuildCmd=0
40BuildCmd=
41
42[VersionInfo]
43Major=0
44Minor=1
45Release=1
46Build=1
47LanguageID=1033
48CharsetID=1252
49CompanyName=
50FileVersion=
51FileDescription=Developed using the Dev-C++ IDE
52InternalName=
53LegalCopyright=
54LegalTrademarks=
55OriginalFilename=
56ProductName=
57ProductVersion=
58AutoIncBuildNr=0
59
60[Unit2]
61FileName=src\stream.h
62CompileCpp=1
63Folder=libbu++
64Compile=1
65Link=1
66Priority=1000
67OverrideBuildCmd=0
68BuildCmd=
69
70[Unit3]
71FileName=src\file.cpp
72CompileCpp=1
73Folder=libbu++
74Compile=1
75Link=1
76Priority=1000
77OverrideBuildCmd=0
78BuildCmd=
79
80[Unit4]
81FileName=src\file.h
82CompileCpp=1
83Folder=libbu++
84Compile=1
85Link=1
86Priority=1000
87OverrideBuildCmd=0
88BuildCmd=
89
90[Unit5]
91FileName=src\fstring.h
92CompileCpp=1
93Folder=libbu++
94Compile=1
95Link=1
96Priority=1000
97OverrideBuildCmd=0
98BuildCmd=
99
100[Unit6]
101FileName=src\fstring.cpp
102CompileCpp=1
103Folder=libbu++
104Compile=1
105Link=1
106Priority=1000
107OverrideBuildCmd=0
108BuildCmd=
109
110[Unit7]
111FileName=src\archival.cpp
112CompileCpp=1
113Folder=libbu++
114Compile=1
115Link=1
116Priority=1000
117OverrideBuildCmd=0
118BuildCmd=
119
120[Unit8]
121FileName=src\archival.h
122CompileCpp=1
123Folder=libbu++
124Compile=1
125Link=1
126Priority=1000
127OverrideBuildCmd=0
128BuildCmd=
129
130[Unit9]
131FileName=src\archive.cpp
132CompileCpp=1
133Folder=libbu++
134Compile=1
135Link=1
136Priority=1000
137OverrideBuildCmd=0
138BuildCmd=
139
140[Unit10]
141FileName=src\archive.h
142CompileCpp=1
143Folder=libbu++
144Compile=1
145Link=1
146Priority=1000
147OverrideBuildCmd=0
148BuildCmd=
149
150[Unit11]
151FileName=src\hash.h
152CompileCpp=1
153Folder=libbu++
154Compile=1
155Link=1
156Priority=1000
157OverrideBuildCmd=0
158BuildCmd=
159
160[Unit12]
161FileName=src\hash.cpp
162CompileCpp=1
163Folder=libbu++
164Compile=1
165Link=1
166Priority=1000
167OverrideBuildCmd=0
168BuildCmd=
169
170[Unit13]
171FileName=src\exceptionbase.cpp
172CompileCpp=1
173Folder=libbu++
174Compile=1
175Link=1
176Priority=1000
177OverrideBuildCmd=0
178BuildCmd=
179
180[Unit14]
181FileName=src\exceptionbase.h
182CompileCpp=1
183Folder=libbu++
184Compile=1
185Link=1
186Priority=1000
187OverrideBuildCmd=0
188BuildCmd=
189
190[Unit15]
191FileName=src\list.cpp
192CompileCpp=1
193Folder=libbu++
194Compile=1
195Link=1
196Priority=1000
197OverrideBuildCmd=0
198BuildCmd=
199
200[Unit16]
201FileName=src\list.h
202CompileCpp=1
203Folder=libbu++
204Compile=1
205Link=1
206Priority=1000
207OverrideBuildCmd=0
208BuildCmd=
209
diff --git a/src/file.cpp b/src/file.cpp
index 368b788..1a8bd08 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -134,19 +134,21 @@ void Bu::File::setBlocking( bool bBlocking )
134 return; 134 return;
135} 135}
136 136
137#ifndef WIN32
137void Bu::File::truncate( long nSize ) 138void Bu::File::truncate( long nSize )
138{ 139{
139 ftruncate( fileno( fh ), nSize ); 140 ftruncate( fileno( fh ), nSize );
140} 141}
141 142
142void Bu::File::flush() 143void Bu::File::chmod( mode_t t )
143{ 144{
144 fflush( fh ); 145 fchmod( fileno( fh ), t );
145} 146}
147#endif
146 148
147void Bu::File::chmod( mode_t t ) 149void Bu::File::flush()
148{ 150{
149 fchmod( fileno( fh ), t ); 151 fflush( fh );
150} 152}
151 153
152bool Bu::File::isOpen() 154bool Bu::File::isOpen()
diff --git a/src/file.h b/src/file.h
index 1a4421b..0f638a7 100644
--- a/src/file.h
+++ b/src/file.h
@@ -47,6 +47,7 @@ namespace Bu
47 *@param sFlags (const char *) Standard file flags 'rb'... etc.. 47 *@param sFlags (const char *) Standard file flags 'rb'... etc..
48 *@returns (Bu::File) A file object representing your temp file. 48 *@returns (Bu::File) A file object representing your temp file.
49 */ 49 */
50#ifndef WIN32
50 inline static Bu::File tempFile( Bu::FString &sName, const char *sFlags ) 51 inline static Bu::File tempFile( Bu::FString &sName, const char *sFlags )
51 { 52 {
52 int afh_d = mkstemp( sName.getStr() ); 53 int afh_d = mkstemp( sName.getStr() );
@@ -66,6 +67,7 @@ namespace Bu
66 *@param t (mode_t) The new file access permissions. 67 *@param t (mode_t) The new file access permissions.
67 */ 68 */
68 void chmod( mode_t t ); 69 void chmod( mode_t t );
70#endif
69 71
70 private: 72 private:
71 FILE *fh; 73 FILE *fh;
diff --git a/src/tests/fstring.cpp b/src/tests/fstring.cpp
index d600be6..48dfc5f 100644
--- a/src/tests/fstring.cpp
+++ b/src/tests/fstring.cpp
@@ -3,12 +3,22 @@
3#include <sys/time.h> 3#include <sys/time.h>
4#include <string> 4#include <string>
5 5
6#ifndef WIN32
6inline double getTime() 7inline double getTime()
7{ 8{
8 struct timeval tv; 9 struct timeval tv;
9 gettimeofday( &tv, NULL ); 10 gettimeofday( &tv, NULL );
10 return ((double)tv.tv_sec) + ((double)tv.tv_usec/1000000.0); 11 return ((double)tv.tv_sec) + ((double)tv.tv_usec/1000000.0);
11} 12}
13#else
14#include "windows.h"
15#include "winbase.h"
16inline double getTime()
17{
18 uint32_t t = (uint32_t) GetTickCount();
19 return (double) t / 1000.0;
20}
21#endif
12 22
13Bu::FString genThing() 23Bu::FString genThing()
14{ 24{