dart icon indicating copy to clipboard operation
dart copied to clipboard

Proposal: New method for returning parsed results

Open mxgrey opened this issue 10 years ago • 2 comments

As it currently stands, a .skel file can return either a Skeleton or a World object. This is somewhat unintuitive, and can probably lead to confusion about which parsing function to call for any given file.

I propose instead returning a struct. Something like this:

struct FileContents
{
  std::vector<WorldPtr> mWorlds;
  std::vector<SkeletonPtr> mSkeletons;
  std::vector<ReferentialSkeletonPtr> mRefSkeletons;
  std::vector<LinkagePtr> mLinkages;
  std::vector<BranchPtr> mBranches;
  std::vector<ChainPtr> mChains;
}

This way everything that a file can possibly contain is obtainable through a single parsing function. It would also address an issue brought up in #378: this would allow ReferentialSkeletons that encapsulate multiple Skeletons to be defined.

mxgrey avatar May 13 '15 16:05 mxgrey

I also wonder if we should consider using a file extension besides .skel, since it sort of implies that the file will only contain a single Skeleton, which is not accurate.

mxgrey avatar May 13 '15 16:05 mxgrey

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 13 '18 19:02 stale[bot]