]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/fg_file.hxx
UIUC flight model contribution. This is based on LaRCsim, but can read
[flightgear.git] / src / Network / fg_file.hxx
index 852fc4936c2d888204481857d0f8f63efdecd397..4029825a5d8ed0be05a14ba831c66cf37786a7db 100644 (file)
 # error This library requires C++
 #endif
 
-#include "Include/compiler.h"
+#include <simgear/compiler.h>
 
 #include <string>
 
 #include <sys/types.h>         // for open(), read(), write(), close()
 #include <sys/stat.h>          // for open(), read(), write(), close()
 #include <fcntl.h>             // for open(), read(), write(), close()
-#include <unistd.h>            // for open(), read(), write(), close()
+#if !defined( _MSC_VER )
+#  include <unistd.h>          // for open(), read(), write(), close()
+#endif
 
 #include "iochannel.hxx"
 #include "protocol.hxx"
@@ -57,11 +59,17 @@ public:
     // open the file based on specified direction
     bool open( FGProtocol::fgProtocolDir dir );
 
-    // read data from file
-    bool read( char *buf, int *length );
+    // read a block of data of specified size
+    int read( char *buf, int length );
+
+    // read a line of data, length is max size of input buffer
+    int readline( char *buf, int length );
 
     // write data to a file
-    bool write( char *buf, int length );
+    int write( char *buf, int length );
+
+    // write null terminated string to a file
+    int writestring( char *str );
 
     // close file
     bool close();