version 1.2, 2004/10/17 20:39:16
|
version 1.8, 2006/11/30 13:27:48
|
|
|
//%2004//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; | // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//============================================================================== |
//============================================================================= |
// | // |
// Author: Tony Fiorentino (fiorentino_tony@emc.com) |
//%//////////////////////////////////////////////////////////////////////////// |
// |
|
// Modified By: Keith Petley (keithp@veritas.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// |
|
| |
#include "Attribute.h" | #include "Attribute.h" |
| |
|
|
| |
Attribute::~Attribute() | Attribute::~Attribute() |
{ | { |
if(_vals.size()) { |
if (_vals.size()) |
|
{ |
_vals.clear(); | _vals.clear(); |
} | } |
} | } |
| |
const Array <String> & |
const Array<String>& Attribute::getValues() const |
Attribute::getValues() const |
|
{ | { |
return _vals; | return _vals; |
} | } |
| |
const String & |
const String& Attribute::getTag() const |
Attribute::getTag() const |
|
{ | { |
return _tag; | return _tag; |
} | } |
| |
void |
void Attribute::addValue(const String& value) |
Attribute::addValue(const String & value) |
|
{ | { |
_vals.append(value); | _vals.append(value); |
} | } |
| |
PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const Attribute& attr) |
PEGASUS_STD(ostream)& operator<<( |
|
PEGASUS_STD(ostream)& os, |
|
const Attribute& attr) |
{ | { |
os << attr.getTag(); | os << attr.getTag(); |
Array <String> vals = attr.getValues(); | Array <String> vals = attr.getValues(); |
for(int i = 0; i < vals.size(); i++) { |
for (Uint32 i = 0; i < vals.size(); i++) |
if(i == 0) { |
{ |
|
if (i == 0) |
|
{ |
os << " = "; | os << " = "; |
} else { |
} |
|
else |
|
{ |
os << " | "; | os << " | "; |
} | } |
os << vals[i]; | os << vals[i]; |