⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cli.hpp

📁 通达信股票软件数据接收程序 能够将连接服务器
💻 HPP
字号:

#ifndef _CLI_HPP_
#define _CLI_HPP_

#include <boost/spirit/core.hpp>
#include <iostream>
#include <string>

#include "stock.h"

///////////////////////////////////////////////////////////////////////////////
using namespace std;
using namespace boost::spirit;

#if 0
struct cli_action
{
	template <typename IteratorT>
	void
	operator()( IteratorT first, IteratorT last ) const
	{
		string s( first, last );
		cout << "\tMy Action got: " << s << endl;
	}
};
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  My grammar
//
///////////////////////////////////////////////////////////////////////////////
struct cli_grammar : public grammar<cli_grammar>
{
	template <typename ScannerT>
	struct definition
	{
		definition( cli_grammar const & self )
		{
			node1 = str_p("show");
			node2 = space_p >> str_p("request");
			node3 = str_p("test");
			root = node1 >> node2[&show_curr_bid];
		}

		rule<ScannerT> root;
		rule<ScannerT> node1;
		rule<ScannerT> node2;
		rule<ScannerT> node3;
		rule<ScannerT> node4;

		rule<ScannerT> const &
		start() const
		{
			return root;
		}
	};
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -