From ec35e73083a6a706cedcdf28fbe76a0eba9fe332 Mon Sep 17 00:00:00 2001 From: Dwayne Boone Date: Mon, 30 Jan 2006 13:35:54 +0000 Subject: Make alternate sequence class not require template --- cpp/src/slice2cppe/Gen.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cpp/src/slice2cppe/Gen.cpp') diff --git a/cpp/src/slice2cppe/Gen.cpp b/cpp/src/slice2cppe/Gen.cpp index 627d1d12560..761f3dce990 100644 --- a/cpp/src/slice2cppe/Gen.cpp +++ b/cpp/src/slice2cppe/Gen.cpp @@ -769,15 +769,17 @@ void Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) { string name = fixKwd(p->name()); - TypePtr type = p->type(); - string s = typeToString(type); + StringList metaData = p->getMetaData(); string seqType = findMetaData(metaData); - if(!seqType.empty()) + if(!seqType.empty() && seqType != "array") { - return; + H << sp << nl << "typedef " << seqType << ' ' << name << ';'; + return; } - + + TypePtr type = p->type(); + string s = typeToString(type); H << sp << nl << "typedef ::std::vector<" << (s[0] == ':' ? " " : "") << s << "> " << name << ';'; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); -- cgit v1.2.3