ホーム » gcc » コンソール AP のための最初のコード

2022年10月
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

カテゴリー

アーカイブ

ブログ統計情報

  • 77,426 アクセス



コンソール AP のための最初のコード

API などをテストするために,個人的に使用している C++ のコード.

#include	<clocale>
#include	<iostream>

#include	"_tdefine.hxx"
#include	"cmd_line.hxx"
#include	"ask_cli.hxx"
//#include	"ask_path.hxx"

bool	test	(c_tstring& str)
{
	std::terr << str << std::endl ;
	return	true ;
	}

inline	bool	call_func	(int argc,TCHAR* argv[])
{
	if (argc > 1) {
		for (int index=1 ; index<argc ; index++) {
			tstring	av = argv[index] ;
			::test(av) ;
			}
		}
	else {
		while(true)	{
			tstring	path ;
			{
				#ifdef	OFN_filter_All
					path = ::ask_path(false) ;
				#else
					path = ::ask_cli(_T("file ... ? =")) ;
				#endif
				}
			if (path.empty())	{	break ;		}
			::test(path) ;
			}
		}
	return	true ;
	}

int	_tmain	(int argc,TCHAR* argv[])
{
	_tsetlocale(LC_ALL,_T("")) ;
	{
		::reg_argv (argc,argv) ;
		}
	{
		::call_func(argc,argv) ;
		}
	{
		::test(_T("Test")) ;
		}
	::ask_wait() ;
	return	0 ;
	}

//#include	"messbar.cxx"

インクルードしているファイルは cpp6_hxx.zip にある.
コンソール AP のための最初のコード
上のコードを test.cpp などとして保存し,同じ所に zip を展開.
g++ test.cpp などでコンパイル可能.


これらを使用したコード.
https://dev.mish.work/wordpress/?s=reg_argv

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.

2件のコメント

コメントは停止中です。

%d人のブロガーが「いいね」をつけました。