aboutsummaryrefslogtreecommitdiffstats
path: root/ApiExtractor/abstractmetabuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't ignore classes in topologysb-4.8-headMatthew Woehlke2015-03-071-3/+0
| | | | | | | | | | | | | | | | | When building the class topology, don't skip classes, even if we are not going to generate code for them. This is necessary to get the topology order correct in a case such as C derived from B derived from A, where B is not generated, but initializing C depends on A being initialized first. Without this change, there is no guaranteed ordering between A and C in such a case. (In particular, this comes up in the Photon test; Photon::ValueIdentity derives from Photon::TemplateBase, which derives from Photon::Base. However, this was not being reflected in the topology, and as a result, it was just luck that the initialization order was correct anyway.) Change-Id: I4b99a50acef3b06e77100a70f2db8236d06af2be Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Process global enums in declaration orderMatthew Woehlke2015-02-191-3/+2
| | | | | | | | | | In the same vein as the previous commit, process global enums in order added (which presumably is declaration order). For what we're doing at this point, this may not be as critical, but again is needed to avoid a spurious test failure. Change-Id: If32a07fee2e7e9b7699e01eda3408ed57855e947 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix function rejections (i.e. support overloads)Matthew Woehlke2014-04-161-0/+12
| | | | | | | | | | | | | | | | | | | | | Add an additional check to AbstractMetaBuilder::traverseFunction to also perform a quick-and-dirty construction of the function signature, and to check that against the rejections. Add a unit test for matching full signatures. Before, we were only testing the function name; as a result, a rejection like 'foo()' would never match (because the name does not have ()'s). This is especially helpful for rejecting specific overloads of functions while allowing others to be wrapped normally. (The unit test shows a not-so-far-fetched example why one might want to do this.) The signature building logic isn't very sophisticated and likely requires a very exacting match to the signature as it appears in the wrapped sources, but that's likely not a serious issue, and at any rate this is much better than not being able to match overloads at all. Change-Id: Ic686377477aacf54f79c7bd2013e9aea8521a4ea Reviewed-by: John Ehresman <jpe@wingware.com>
* Don't warn when inheriting from containerMatthew Woehlke2013-10-091-5/+10
| | | | | | | | | | Change AbstractMetaBuilder::setupInheritance to not warn about classes that inherit from known container types, even if the container type does not have a corresponding wrapper class (which in many or most cases it won't). Remove now-unneeded suppression for the same in 'sample'. Change-Id: I0a45636791eba36cf070ea082eb6ead6cb5947ef Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Fix finding container base classesMatthew Woehlke2013-10-091-32/+62
| | | | | | | | | | | | | | | Move logic to find template classes to its own helper method, and newly use the helper in AbstractMetaBuilder::getBaseClasses. This fixes the latter not finding template base classes, which fixes class topological sorting in some cases. Unfortunately I have not figured out a reliable unit test for this, although printing a debug warning when finding the parent fails (or when a template lookup succeeds) is able to verify that this change is doing something useful. Change-Id: I2a5e0df4035393288b6f69ebc41dc0e64866a182 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Revert "Remove useless code."Matthew Woehlke2013-10-091-0/+3
| | | | | | | | | | | | | | This reverts commit 02c6e63ac8dbb8acde3bc19abd36fff0db65fd11. Apparently types derived from containers can have a container base class without the container class having a metaclass. This fixes the sample_strlist unit test crashing. (There may be another bug here, in Shiboken's don't-write-generated-source-if-not-changed logic, as the failure doesn't seem to reliably appear/disappear after an incremental build.) Change-Id: I5f60bfb784dca02d9766a32e7b7b8a8a529df5af Reviewed-by: John Ehresman <jpe@wingware.com>
* Refactor and improve added function resolvingMatthew Woehlke2013-09-261-14/+60
| | | | | | | | | | | | | | | | | | | | | | | | | Add a public function to create an AddedFunction::TypeInfo from a signature string. Change translateType to use this to do full recursive resolution on template arguments. Create a new helper function to do more intelligent parsing of template type name signatures, and use this in translateType. Taken together, this means that we now recognize both multiple arguments to template types of added functions, as well as template arguments that are themselves template types. We couldn't do this before due to the use of a regular expression to attempt to separate the template type name from its arguments. The test cases are updated to test these new features. Note, however, that it is now a fatal error if the template argument type cannot be determined. (Before we would just drop it and treat the type as a non-container.) However, 1) this should not be happening in a well formed type system, and 2) it's questionable if things wouldn't have fallen apart anyway from treating the presumed container as something else. Change-Id: I23c3a7f7e311e046642d951d6ad2236571fda6b8 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Remove useless code.Matthew Woehlke2013-09-251-3/+0
| | | | | | | | | | | | Remove code to set the type entry base container type in AbstractMetaBuilder::setupInheritance outside of setting up the container meta class. We do it anyway when the meta class is found, and fail if we can't find the meta class, so having just the type entry set is not really useful. (And this will allow us to simplify the code going forward.) Change-Id: I90389efc574d516703df0d6a26ba130769adfea7 Reviewed-by: John Cummings <jcummings2@users.sf.net>
* Replaced Nokia copyrights in headerTeemu Kaukoranta2013-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Replaced old Nokia copyrights with Digia copyrights. Removed "All rights reserved" strings without leading copyrights were removed (for example, 'Copyright SomeCompany, all rights reserved remain untouched). Did NOT touch contact details, will change them later. Excluded folders that have '3rdparty' in path. Used command: find . -path '*/3rdparty/*' -prune -o -exec grep -ilI -E '.*Copyright.*Nokia.*' {} \; | tee >(xargs sed -i -r '1,10 s/([ \t#*]*)(.*Copyright.*Nokia.*)/ \1Copyright \(C\) 2013 Digia Plc and\/or its subsidiary\(-ies\)\./I') >(xargs sed -i -r '1,10 s/(^[ \t#*]*)(all rights reserved.*)/\1/I') This excludes binary files and retains whitespace and #* characters in the beginning of the edited lines. Change-Id: I0d49f991c3dbd45d804843f185714e8681bc6c51 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com>
* Move ApiExtractor into ApiExtractor directory to ease the merge into Shiboken.Hugo Parente Lima2012-03-131-0/+2962