本文整理汇总了C++中Log::Message方法的典型用法代码示例。如果您正苦于以下问题:C++ Log::Message方法的具体用法?C++ Log::Message怎么用?C++ Log::Message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::Message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintKeywordInfo
static void PrintKeywordInfo(Log& output, const std::pair<std::string, Tokens>& key, size_t maxLen)
{
static const size_t minSepCount = 3;
/* Get final keyword info line */
std::string info = key.first;
auto hint = KeywordHint(key.second);
if (hint)
info += std::string(maxLen - info.size() + minSepCount, ' ') + std::string(hint);
/* Push scoped color */
std::unique_ptr<ScopedColor> color;
switch (key.second)
{
case Tokens::Macro:
color = MakeUnique<ScopedColor>(output.stream, Color::Green | Color::Intens);
break;
case Tokens::Reserved:
color = MakeUnique<ScopedColor>(output.stream, Color::Red | Color::Intens);
break;
}
/* Print message */
output.Message(info);
}
示例2: PrintAttribs
static void PrintAttribs(Log& output)
{
/* Print attributes */
output.Headline("attributes:");
for (const std::string& attr : { Attrib::idDeprecated,
Attrib::idFinal,
Attrib::idOverride,
Attrib::idExport,
Attrib::idBind,
Attrib::idSet,
Attrib::idGet })
{
output.Message(attr);
}
}
示例3: Execute
void ReplyCommand::Execute(StreamParser& input, Log& output)
{
using Flags = Assembler::QueryFlags;
/* Parse input argument */
auto filename = input.Accept();
BitMask flags;
while (true)
{
if (!flags(Flags::ExportAddresses) && input.Get() == "--exp-addr")
{
input.Accept();
flags << Flags::ExportAddresses;
}
else if (!flags(Flags::ImportAddresses) && input.Get() == "--imp-addr")
{
input.Accept();
flags << Flags::ImportAddresses;
}
else if (!flags(Flags::Invocations) && input.Get() == "--invk")
{
input.Accept();
flags << Flags::Invocations;
}
else if ( !flags(Flags::SortByName) && ( input.Get() == "-S" || input.Get() == "--sort" ) )
{
input.Accept();
flags << Flags::SortByName;
}
else
break;
}
/* Show output */
if (flags)
Assembler::QueryByteCodeInformation(output, filename, flags);
else
output.Message("reply: nothing to be done");
}
示例4: PrintSearchPaths
static void PrintSearchPaths(Log& output)
{
output.Headline("search paths:");
output.Message("library path: \"" + SearchPaths::LibraryPath());
output.Message("module path: \"" + SearchPaths::ModulesPath());
}