[PR]

水無瀬の部屋 > Programming > sample > tools > filefmt > icofile.cpp
最終更新日: 2007/03/10

   1: //*********************************************************
   2: // プロジェクト: ICON file
   3: //   ファイル名: icofile.cpp
   4: //*********************************************************
   5: #include <filefmt/icofile.h> //
   6: #include <header/tooldbg.h>  // ASSERT(), 
   7: #include <header/toolbase.h> // 
   8: 
   9: 
  10: //*********************************************************
  11: // ReadIconFileHeader
  12: //*********************************************************
  13: bool
  14: ReadIconFileHeader
  15: 	(
  16: 		FILE         *fp,
  17: 		ICONFILEHEAD *ifh
  18: 	)
  19: {
  20: 	// パラメタの仮定
  21: 	ASSERT( IsValidFilePtr( fp ) );
  22: 	ASSERT( IsValidPtr( ifh, sizeof( *ifh ) ) );
  23: 
  24: 	return 1 == fread( ifh, sizeof( *ifh ), 1, fp );
  25: }//ReadIconFileHeader
  26: 
  27: //*********************************************************
  28: // ReadIconInfoHeader
  29: //*********************************************************
  30: bool
  31: ReadIconInfoHeader
  32: 	(
  33: 		FILE         *fp,
  34: 		ICONINFOHEAD *iih
  35: 	)
  36: {
  37: 	// パラメタの仮定
  38: 	ASSERT( IsValidFilePtr( fp ) );
  39: 	ASSERT( IsValidPtr( iih, sizeof( *iih ) ) );
  40: 
  41: 	return 1 == fread( iih, sizeof( *iih ), 1, fp );
  42: }//ReadIconInfoHeader
  43: 
  44: //*********************************************************
  45: // ReadIconInfoHeaderBlock
  46: //*********************************************************
  47: bool
  48: ReadIconInfoHeaderBlock
  49: 	(
  50: 		FILE               *fp,
  51: 		ICONINFOHEAD       *iih,
  52: 		const ICONFILEHEAD *ifh
  53: 	)
  54: {
  55: 	// パラメタの仮定
  56: 	ASSERT( IsValidFilePtr( fp ) );
  57: 	ASSERT( IsValidReadPtr( ifh, sizeof( *ifh ) ) );
  58: 	ASSERT( IsValidPtr( iih, ifh->num * sizeof( *iih ) ) );
  59: 	ASSERT( 0 < ifh->num );
  60: 
  61: 	{for( int i = 0; i < (int)ifh->num; ++i )
  62: 	{
  63: 		if ( !ReadIconInfoHeader( fp, &iih[ i ] ) )
  64: 		{
  65: 			return false;
  66: 		}
  67: 	}}
  68: 
  69: 	return true;
  70: }//ReadIconInfoHeaderBlock
  71: 
  72: 
  73: //** end **
  74: 

参照:


Google
ご意見・ご感想をお聞かせ下さい。匿名で送信できます。

 * 返信が必要な場合には postmaster@katsura-kotonoha.sakura.ne.jp へ直接メールしてください。

水無瀬の部屋 > sample > tools > filefmt > icofile.cpp

このページは cpp2web が出力しました。
水無瀬 優 postmaster@katsura-kotonoha.sakura.ne.jp
http://katsura-kotonoha.sakura.ne.jp/prog/code/tools/filefmt/icofile_cpp.shtml
同人ダウンロード販売
同人ダウンロード販売|DL.Getchu.com