「関数一覧」の編集履歴(バックアップ)一覧はこちら
「関数一覧」(2011/04/12 (火) 01:06:52) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
-インクルード
#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 next = filename.find( "/", 0 ); next != string::npos; next = filename.find( "/", next ) ) {
string path = filename.substr( 0, next );
_mkdir( path.c_str() );
next++;
}
}
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()
-インクルード
#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()