Generic: Create a copy constructor
Track tags need a copy constructor to keep library size accurate, so create one here.
This commit is contained in:
parent
4edbd69fa7
commit
44aac0dcec
|
@ -12,6 +12,11 @@ GenericTag :: GenericTag(const std::string &name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GenericTag :: GenericTag(const GenericTag &tag)
|
||||||
|
: _name(tag._name), _lower(tag._lower)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
const std::string GenericTag :: primary_key() const
|
const std::string GenericTag :: primary_key() const
|
||||||
{
|
{
|
||||||
return _name;
|
return _name;
|
||||||
|
|
|
@ -35,6 +35,13 @@ public:
|
||||||
*/
|
*/
|
||||||
GenericTag(const std::string &);
|
GenericTag(const std::string &);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic tag copy constructor.
|
||||||
|
*
|
||||||
|
* @param tag The tag that should be copied.
|
||||||
|
*/
|
||||||
|
GenericTag(const GenericTag &);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to access the generic tag's primary key.
|
* Called to access the generic tag's primary key.
|
||||||
*
|
*
|
||||||
|
|
|
@ -30,6 +30,11 @@ static void test_generic_tag()
|
||||||
test_equal(tag.name(), (std::string)"Generic Tag");
|
test_equal(tag.name(), (std::string)"Generic Tag");
|
||||||
test_equal(tag.lowercase(), (std::string)"generic tag");
|
test_equal(tag.lowercase(), (std::string)"generic tag");
|
||||||
test_equal(tag.primary_key(), (std::string)"Generic Tag");
|
test_equal(tag.primary_key(), (std::string)"Generic Tag");
|
||||||
|
|
||||||
|
tag = GenericTag(tag);
|
||||||
|
test_equal(tag.name(), (std::string)"Generic Tag");
|
||||||
|
test_equal(tag.lowercase(), (std::string)"generic tag");
|
||||||
|
test_equal(tag.primary_key(), (std::string)"Generic Tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_generic_tag_comparison()
|
static void test_generic_tag_comparison()
|
||||||
|
|
Loading…
Reference in New Issue