📄 check1.h
字号:
// Check1.h: interface for the CCheck class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHECK1_H__5614CDB9_5C2F_494D_866E_9A503BA23A27__INCLUDED_)
#define AFX_CHECK1_H__5614CDB9_5C2F_494D_866E_9A503BA23A27__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#pragma warning (disable : 4786)
#include <vector>
using namespace std;
struct LINE_INFO
{
char* line_start;
char* line_end;
};
struct OPTION
{
bool return_as_break;
};
class CCheck
{
public:
CCheck();
virtual ~CCheck();
public:
void check_file (const char* file);
void set_tree (CTreeCtrl& tree) { m_tree = &tree; }
void set_opt (bool return_as_break) { m_opt.return_as_break = return_as_break; }
private:
bool read_file (const char* file);
void clr_buf ();
void check_switch ();
void check_char ();
void check_case (const char* ptr);
void check_stmt (const char* ptr);
void check_stmt (const char* ptr, bool& is_break_in_stmt);
void check_default (const char* ptr);
bool is_comment ();
bool is_white_space ();
bool is_quote ();
bool is_var_char (const char c);
void skip_nop ();
void skip_comment ();
void skip_white_space ();
void skip_quotes ();
void move_next (int n = 1);
bool get_token (const char* token);
char* get_next_token ();
void init_line_info ();
bool lookup_line (const char* p, int& line_num, std::string& content);
void alert (const char* ptr);
int get_file_icon (const char* file);
int get_err_icon ();
void refresh_tree () { if (m_tree) { m_tree->Invalidate(); m_tree->UpdateWindow(); }}
private:
std::vector<LINE_INFO> m_setline_info;
char* m_buf;
int m_len;
int m_last_alert;
CTreeCtrl* m_tree;
HTREEITEM m_item;
OPTION m_opt;
char* m_file;
};
#endif // !defined(AFX_CHECK1_H__5614CDB9_5C2F_494D_866E_9A503BA23A27__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -