5 static const unsigned char utf8_header[3] = {0xEF,0xBB,0xBF};
11 p_file->seek(0,p_abort);
12 p_file->set_eof(p_abort);
16 p_file->write_object(p_string,strlen(p_string),p_abort);
22 p_file->write_object(bah,bah.
length(),p_abort);
24 throw exception_io_data();
31 if (p_file->can_seek())
33 p_file->seek(0,p_abort);
38 size64 = p_file->get_size(p_abort);
43 enum {delta = 1024*64, max = 1024*512};
46 done = p_file->read(temp,3,p_abort);
59 done = p_file->read(mem.
get_ptr(),delta,p_abort);
65 if (done < delta)
break;
77 if (size64>1024*1024*128)
throw exception_io_data();
78 t_size size = pfc::downcast_guarded<t_size>(size64);
81 p_file->read_object(asdf,size,p_abort);
95 filesystem::g_open_write_new(f,p_path,p_abort);
96 write(f,p_abort,p_string,is_utf8);
102 filesystem::g_open_read(f,p_path,p_abort);
103 read(f,p_abort,p_out,is_utf8);
void read(const service_ptr_t< file > &p_file, abort_callback &p_abort, pfc::string_base &p_out, bool &is_utf8)
const t_item * get_ptr() const
virtual void add_string(const char *p_string, t_size p_length=~0)=0
static const t_filesize filesize_invalid
Invalid/unknown file size constant. Also see: t_filesize.
string_utf8_from_win1252 string_utf8_from_ansi
void add_string(const char *p_string, t_size p_length=~0)
void set_size(t_size p_size)
void write(const service_ptr_t< file > &p_file, abort_callback &p_abort, const char *p_string, bool is_utf8)
t_uint64 t_filesize
Type used for file size related variables.
static const unsigned char utf8_header[3]