「関数一覧」の編集履歴(バックアップ)一覧はこちら
関数一覧 - (2010/09/10 (金) 16:13:32) の最新版との変更点
追加された行は緑色になります。
削除された行は赤色になります。
-インクルード
<string>
<cstdio>
-文字定数
不明(多分int) O_RDONLY
不明(多分int) O_BINARY
-as名前空間
int open_or_die(const string in_filename, 不明(多分int) openmode)
string get_file_prefix(const string in_filename)
不明 unlzss(unsigned char *buff, unsigned long len, unsigned char *&out_buff, unsigned long &out_len)
-グローバル
不明 close(int fd)
&link_edit(text=ここを編集)
#comment()
-インクルード
#include <cstdio>
#include <direct.h>
#include <errno.h>
#include <fcntl.h>
#include <io.h>
#include <iostream>
#include <stdio.h>
#include <string.h>
-名前空間
using namespace std;
int as::open_or_die( const string in_filename, int in_openflag, int in_permissionmode = 0 ) {
int ret = _open( in_filename.c_str(), in_openflag, in_permissionmode );
if( ret == -1) {
fprintf( stderr, "Could not open %s (%s)\n", in_filename.c_str(), strerror(errno) );
exit( -1 );
}
return ret;
}
/* 代替コード */
void as::make_path(const string filename) {
for( unsigned int offset = filename.find( "/", 0 ); offset != string::npos; offset = filename.find( "/", offset ) ) {
string path = filename.substr( 0, offset );
_mkdir( path.c_str() );
offset++;
}
}
void as::write_file( const string filename, unsigned char* buff, unsigned long len ) {
int fd = open_or_die( filename, O_BINARY | O_CREAT | O_TRUNC | O_WRONLY, O_CREAT | O_NOINHERIT );
_write( fd, buff, len );
_close( fd );
}
string as::get_file_prefix(const string in_filename)
不明 as::unlzss(unsigned char *buff, unsigned long len, unsigned char *&out_buff, unsigned long &out_len)
&link_edit(text=ここを編集)
#comment()