ultimatepp/uppsrc/ide/MacroManager/MacroElement.cpp
cxl adc0a61b61 MS build tools autosetup
git-svn-id: svn://ultimatepp.org/upp/trunk@11218 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2017-07-06 17:05:47 +00:00

35 lines
584 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();
}
return Image();
}
String MacroElement::GetContent() const
{
String content = TrimBoth(comment);
if(content.GetCount())
content << "\n";
content << prototype << code;
return content;
}
}