C/C++ guidelines for porting ActionScript

28 February 2013
  • Dictionary becomes std::map
  • Array becomes std::vector
  • Vector becomes std::vector
  • String becomes std::string
  • Enumerations become strings
  • uint becomes unsigned int
  • Boolean becomes bool
  • Number becomes float
    • becomes void *
  • Implements, Extents become public
  • Interface becomes class
  • Accessors are implemented explicitly, e.g. getMemberVariable(), setMemberVariable()
  • .push becomes .push_back
  • .pop becomes .pop_back
  • .length becomes .size
  • null becomes NULL
  • undefined becomes NULL
  • trace becomes std::cout
  • new Event(“TYPE”, false, Unknown macro: { property, property }) becomes new Event(std::string, bool bubbles, type property, type property));
  • for each(thing in container) becomes for(std::vector<thing>::iterator thing = container.begin(); thing != container.end(); ++thing)
  • Adobe::Object and Adobe::Class types have no equivalence, these are a PITA
  • Follow file naming conventions