diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-01-05 19:03:34 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-01-05 19:03:34 +0000 |
commit | 808c943027afe2556c214cd1a7a3655e11f2b5ab (patch) | |
tree | cac03d2d376d27f12974622d0dba4886351b554d | |
parent | Use boost::program_options for cli (diff) | |
download | slicer-808c943027afe2556c214cd1a7a3655e11f2b5ab.tar.bz2 slicer-808c943027afe2556c214cd1a7a3655e11f2b5ab.tar.xz slicer-808c943027afe2556c214cd1a7a3655e11f2b5ab.zip |
Extract conversions from any metadata
-rw-r--r-- | slicer/slicer/parser.cpp | 6 | ||||
-rw-r--r-- | slicer/slicer/parser.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/slicer/slicer/parser.cpp b/slicer/slicer/parser.cpp index 96dd9b6..d401f5b 100644 --- a/slicer/slicer/parser.cpp +++ b/slicer/slicer/parser.cpp @@ -29,7 +29,7 @@ namespace Slicer { auto type = dm->type(); auto c = Slice::ContainedPtr::dynamicCast(dm->container()); - auto conversions = getConversions(dm); + auto conversions = getConversions(dm->getMetaData()); for (const auto & conversion : conversions) { fprintf(cpp, "%s %s(const %s &);\n", conversion.ExchangeType.c_str(), @@ -429,10 +429,10 @@ namespace Slicer { std::vector<Slicer::ConversionSpec> - Slicer::getConversions(Slice::DataMemberPtr dm) + Slicer::getConversions(const std::list<std::string> & dm) { std::vector<ConversionSpec> rtn; - auto conversions = metaDataValues("slicer:conversion:", dm->getMetaData()); + auto conversions = metaDataValues("slicer:conversion:", dm); for (const auto & conversion : conversions) { auto split = metaDataSplit(conversion); if (split.size() != 3) { diff --git a/slicer/slicer/parser.h b/slicer/slicer/parser.h index 9be2465..a29ede9 100644 --- a/slicer/slicer/parser.h +++ b/slicer/slicer/parser.h @@ -48,7 +48,7 @@ namespace Slicer { void defineConversions(Slice::DataMemberPtr dm) const; void copyMetadata(const std::list<std::string> & metadata) const; - static std::vector<ConversionSpec> getConversions(Slice::DataMemberPtr); + static std::vector<ConversionSpec> getConversions(const std::list<std::string> & metadata); unsigned int components; FILE * cpp; |