Const-ify Define class

svn path=/trunk/; revision=29680
This commit is contained in:
Hervé Poussineau 2007-10-19 13:20:27 +00:00
parent bcb862e4f0
commit 7b57d6a08d
3 changed files with 11 additions and 14 deletions

View file

@ -33,7 +33,7 @@ Define::Define ( const Project& project,
}
Define::Define ( const Project& project,
const Module* module,
const Module* module,
const XMLElement& defineNode )
: project(project),
module(module),
@ -43,16 +43,16 @@ Define::Define ( const Project& project,
}
Define::Define ( const Project& project,
const Module* module,
const std::string name_,
const std::string backend_)
const Module* module,
const std::string& name_,
const std::string& backend_)
: project(project),
module(module),
node(NULL)
{
name = name_;
value = "";
backend = backend_;
backend = backend_;
}
Define::~Define ()
@ -63,13 +63,12 @@ void
Define::Initialize()
{
const XMLAttribute* att = node->GetAttribute ( "name", true );
const XMLAttribute* empty = node->GetAttribute ( "empty", false );
const XMLAttribute* bck = node->GetAttribute ( "backend", false );
const XMLAttribute* bck = node->GetAttribute ( "backend", false );
assert(att);
name = att->value;
value = node->value;
if ( bck ) backend = bck->value;
if( empty ) value = " ";
value = node->value;
if ( bck )
backend = bck->value;
}
void

View file

@ -37,8 +37,6 @@
<!ELEMENT define (#PCDATA)>
<!ATTLIST define
name %CIdentifier; #REQUIRED
value %Text; #IMPLIED
empty (true) #IMPLIED
>
<!ELEMENT directory (compilationunit*|directory*|group*|cdfile|file*|if*|ifnot*|module+|pch*|xi:include*)+>

View file

@ -434,8 +434,8 @@ public:
const XMLElement& defineNode );
Define ( const Project& project,
const Module* module,
const std::string name_,
const std::string backend_ = "" );
const std::string& name_,
const std::string& backend_ = "" );
~Define();
void ProcessXML();
private: