Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
34
cde/programs/nsgmls/StringSet.C
Normal file
34
cde/programs/nsgmls/StringSet.C
Normal file
@@ -0,0 +1,34 @@
|
||||
/* $XConsortium: StringSet.C /main/1 1996/07/29 17:05:31 cde-hp $ */
|
||||
// Copyright (c) 1994 James Clark
|
||||
// See the file COPYING for copying permission.
|
||||
|
||||
#include "config.h"
|
||||
#include "StringSet.h"
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
namespace SP_NAMESPACE {
|
||||
#endif
|
||||
|
||||
StringSet::StringSet()
|
||||
{
|
||||
}
|
||||
|
||||
Boolean StringSet::add(const StringC &str)
|
||||
{
|
||||
StringC *p = table_.lookup(str);
|
||||
if (p)
|
||||
return 1;
|
||||
p = new StringC(str);
|
||||
table_.insert(p);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void StringSet::swap(StringSet &to)
|
||||
{
|
||||
table_.swap(to.table_);
|
||||
}
|
||||
|
||||
|
||||
#ifdef SP_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user