29 #ifndef FILE_ACCESS_NETWORK_H 30 #define FILE_ACCESS_NETWORK_H 32 #include "os/file_access.h" 33 #include "os/semaphore.h" 34 #include "os/thread.h" 35 #include "io/stream_peer_tcp.h" 57 Mutex *blockrequest_mutex;
65 static void _thread_func(
void *s);
67 void put_32(
int p_32);
68 void put_64(int64_t p_64);
82 Error connect(
const String& p_host,
int p_port,
const String& p_password=
"");
98 mutable bool eof_flag;
99 mutable int last_page;
100 mutable uint8_t *last_page_buff;
106 mutable int waiting_on_page;
107 mutable int last_activity_val;
112 Page() { activity=0; queued=
false; }
117 mutable Error response;
119 uint64_t exists_modtime;
121 void _queue_page(
int p_page)
const;
122 void _respond(
size_t p_len,Error p_status);
138 RESPONSE_FILE_EXISTS,
139 RESPONSE_GET_MODTIME,
143 virtual Error _open(
const String& p_path,
int p_mode_flags);
144 virtual void close();
145 virtual bool is_open()
const;
147 virtual void seek(
size_t p_position);
148 virtual void seek_end(int64_t p_position=0);
149 virtual size_t get_pos()
const;
150 virtual size_t get_len()
const;
152 virtual bool eof_reached()
const;
154 virtual uint8_t get_8()
const;
155 virtual int get_buffer(uint8_t *p_dst,
int p_length)
const;
157 virtual Error get_error()
const;
159 virtual void store_8(uint8_t p_dest);
161 virtual bool file_exists(
const String& p_path);
163 virtual uint64_t _get_modified_time(
const String& p_file);
169 #endif // FILE_ACCESS_NETWORK_H
Definition: file_access_network.h:89
Definition: file_access_network.h:39
Definition: semaphore.h:37
Definition: file_access.h:40