トップ «前の日記(2007-05-10) 最新 次の日記(2007-05-12)» 編集

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|

2007-05-11 :-)

_ [仕事]仕事

0830 出勤。

おやつがたくさん。

_ [C++][boost]素人が書く C++

ファイル削除。Boost を使います。

#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <iostream>
#include <string>

using namespace std;
namespace fs = boost::filesystem;

int main( int ac, char** av )
{
  string fn = av[ 1 ];
  string sout = "hello";
  string sin;

  ofstream fout( fn.c_str() );
  ifstream fin( fn.c_str() );
  fout << sout << endl;
  fin >> sin;
  cout << sin << endl;
  fout.close();
  fin.close();

  if( fs::exists( fn ) )
    cout << "found: " << fn << endl;

  fs::remove( fn );  // ファイル削除
  if( !fs::exists( fn ) )
    cout << "not found: " << fn << endl;

  return 0;
}

実行します。

>file0 test.txt
hello
found: test.txt
not found: test.txt

_ 素人が書く C++

ディレクトリを再帰的に辿ってディレクトリの下にあるファイル名を印字する。Boost を使用。find . -type f とかコマンドプロンプトの dir /s/b みたいなものです。

#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <iostream>

using namespace std;
namespace fs = boost::filesystem;

void dirent( const fs::path& dir )
{
  if( !fs::exists( dir ) ) return;

  fs::directory_iterator end;
  for( fs::directory_iterator it( dir ); it != end; it++ )
  {
    cout << it->string() << endl;
    if( fs::is_directory( *it ) )
      dirent( *it );
  }
}


int main( int ac, char** av )
{
  fs::path dirp( av[ 1 ] );
  dirent( dirp );
  return 0;
}

_ [C++][boost]素人が書く C++

ファイル名を検索する。boost を使用。find . -type d -name foo とかコマンドプロンプトの dir /s/b foo みたいなものです。

#include <boost/regex.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <iostream>

using namespace std;
namespace fs = boost::filesystem;

void dirent( const fs::path& dir, const boost::regex& pattern )
{
  if( !fs::exists( dir ) ) return;

  fs::directory_iterator end;
  for( fs::directory_iterator it( dir ); it != end; it++ )
  {
    if( boost::regex_search( it->leaf(), pattern ) )
      cout << it->string() << endl;
    if( fs::is_directory( *it ) )
      dirent( *it, pattern );
  }
}

int main( int ac, char** av )
{
  fs::path dirp( av[ 1 ] );
  boost::regex pattern( av[ 2 ] );
  dirent( dirp, pattern );
  return 0;
}

_ [EXTRA]EXTRA - HYPER GAME MUSIC EVENT 2007

THE BLACK MAGES も参加するという EXTRA です。出演者が果てしなく豪華です。

  • 伊藤賢治
  • 岩田匡治
  • 大久保博
  • 河本圭代
  • 古代祐三
  • 﨑元仁
  • 田中宏和
  • 並木学
  • 日比野則彦
  • 細江慎治
  • 松前公高
  • 山岡晃
  • [H.]
  • THE BLACK MAGES

週刊ファミ通に先行予約応募券があるということで週刊ファミ通を買ってきました。チケットはひとり 4 枚まで応募可能ということで 4 枚応募してみます。当落通知は 6/20 に来るそうです。

ref. “THE BLACK MAGES”ライブ出演が決定!!

img_3995.jpg

_ [鮭ハラス][]飯

鮭ハラス

_ [おやつ][東武ホテル][焼き菓子]おやつ

昨日に引き続き東武ホテルの焼き菓子。