ultimatepp/uppsrc/ide/MacroManager/MacroElement.cpp
cxl d3b70d407e urepo added to canonical upp.src packages; cosmetics
git-svn-id: svn://ultimatepp.org/upp/trunk@11377 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2017-10-14 11:00:29 +00:00

37 lines
642 B
C++

#include "MacroManager.h"
namespace Upp {
MacroElement::MacroElement(Type type, const String& fileName, int line, const String& comment)
: type(type)
, comment(comment)
, fileName(fileName)
, line(line)
{}
Image MacroElement::GetImage() const
{
switch(type)
{
case(Type::MACRO):
return MacroManagerImg::Macro();
case(Type::FUNCTION):
return MacroManagerImg::Fn();
case(Type::UNKNOWN): // silence CLANG warning
break;
}
return Image();
}
String MacroElement::GetContent() const
{
String content = TrimBoth(comment);
if(content.GetCount())
content << "\n";
content << prototype << code;
return content;
}
}