上一篇文章带你玩转Visual Studio——带你了解VC++各种类型的工程一文中讲了各种类型VC++工程的主要功能和用途。现在将带你一起快速开发c++程序。
有过Java开发经验的人都知道Java的常用开发工具(如Eclipse、Intellij IDEA等)都有非常强大的关键字高亮、智能提示、快速追踪等的功能。那也许你就要问了:进行C++开发的Visual Studio是否也有这个功能呢?首先要说明的是Visual Studio本身并没有这么强大的功能(至少VS2010及之前版本是这样的,有一些简单的代码跟踪能力但是很难用),但它有一个非常强大和好用的插件有这些功能,它就量VassistX,也称为VC助手,它就是本文要讲的内容。
Visual Assist X Snippets 宏
. | Reserved String | Meaning | 样例或说明 |
---|---|---|---|
Date | DATE | Year/month/day formatted as %04d/%02d/%02d | 2015/10/02 |
DATELOCALE | Current date in locale format | 本地化格式境 | |
DAY | Day of month formatted as %d | 2 | |
DAY02 | Day of month formatted as %02d | 02 | |
DAYNAME | Day abbreviation in locale format | //Fri | |
DAYLONGNAME | Full name of day in locale format | //Friday | |
MONTH | Month formatted as %d | 10 | |
MONTH02 | Month formatted as %02d | 10 | |
MONTHNAME | Month abbreviation in locale format | Oct | |
MONTHLONGNAME | Full name of month in locale format | October | |
YEAR | Year formatted as %d | 2015 | |
YEAR02 | Year formatted as %02d | 15 | |
Time | HOUR | Hour formatted as %d | 16 |
HOUR02 | Hour formatted as %02d | 16 | |
MINUTE | Minute formatted as %02d | 29 | |
SECOND | Second formatted as %02d | 30 | |
File | FILE | Full filename with path* | D:CppWorkspaceDesignPatternDesignPatternWater.h |
FILEUPPER | Full filename with path in uppercase* | D:CPPWORKSPACEDESIGNPATTERNDESIGNPATTERNWATER.H | |
FILEBASE | Filename without path or extension* | Water | |
FILEBASEUPPER | Filename without path or extension in upper case* | WATER | |
FILEEXT | Filename extension* | h | |
FILEEXTUPPER | Filename extension in upper case* | H | |
FILEPATH | Path of file* | D:CppWorkspaceDesignPatternDesignPattern | |
FILEPATHUPPER | Path of file in upper case* | D:CPPWORKSPACEDESIGNPATTERNDESIGNPATTERN | |
General | clipboard | Current clipboard | 当前剪贴板内容 |
end | Position of caret after expansion | 输入完成光标位置 | |
selected | Current selection** | 选定内容 | |
$$ | Literal ‘$’ character | $转义 | |
Symbol Context | MethodName | Name of containing method | |
MethodArgs | Method parameters | 函数参数列表 | |
ClassName | Name of containing class | 类名称 | |
BaseClassName | Name of base class of containing class | 基类名称 | |
NamespaceName | Fully qualified namespace name | 命名空间 | |
GUID | GUIDDEFINITION | Generated GUID formatted for use in a definition | GUID定义,“,”分割 |
GUIDSTRING | Generated GUID formatted for use in a string | GUID字符串,“-”分割 | |
GUIDSTRUCT | Generated GUID formatted for use in a struct | GUID结构 | |
GUIDSYMBOL | Generated GUID formatted with underscores | GUID符号,”_”分割 | |
GUIDSTRINGUPPER | Uppercase version of GUIDSTRING | 略 | |
GUIDSTRUCTUPPER | Uppercase version of GUIDSTRUCT | 略 | |
GUIDSYMBOLUPPER | Uppercase version of GUIDSYMBOL | 略 | |
The following reserved strings are available only in refactoring snippets | |||
Refactor | GeneratedPropertyName | Property name generated during Encapsulate Field | 与类属性同名的访问方法,首字符大写(类似Java中的Set/Get方法) |
generatedPropertyName | Same as GeneratedPropertyNamebut with lower-case first letter | 与类属性同名的访问方法,首字符小写 | |
MethodArg | One parameter of the method and its type | 不可用 | |
MethodArgName | One parameter of the method | 方法参数 | |
MethodArgType | Type of one parameter of the method | 函数体 | |
MethodBody | Body of implementation | 函数体 | |
MethodQualifier | Optional qualifiers of method | 尚不清楚 | |
ParameterList | Parameters separated by commas | 参数列表 | |
SymbolContext | Context and name of method | 函数全名(含类信息等) | |
SymbolName | Name of method | 函数名称 | |
SymbolPrivileges | Access of method | 访问控制 | |
SymbolStatic | Keyword static or blank | static | |
SymbolType | Return type of method | 函数返回类型 | |
SymbolVirtual | Keyword virtual or blank | virtual |
上一篇回顾:
带你玩转Visual Studio——带你了解VC++各种类型的工程
下一篇要讲述的内容:
带你玩转Visual Studio——带你高效管理代码