Skip to content

MozOverride is a mozilla CXX11 script that annotates mother-class overriding methods with MOZ_OVERRIDE

License

Notifications You must be signed in to change notification settings

Sixdsn/MOZ_OVERRIDE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOZ_OVERRIDE

This script is using the CppHeaderParser Module available here:

https://pypi.python.org/pypi/CppHeaderParser/

This module is developped by senex (Jashua Cloutier) who does a real good job on it :)

You just need to install it

$>pip install cppheaderparser

MOZ_OVERRIDE is a script I developped for Mozilla wich recreates the whole heritage tree for all classes in mozilla-central.

Of course it can be used anywhere, but is designed for mozilla. The wiki will be updated soon to show how to adapt it to another behaviour.

It finds classes that inherits from a base class and annotate them with MOZ_OVERRIDE (override in C++11).

I should be able to enhance it to be able to give some specific details on modules and/or classes such as parents, childs, overrided methods, etc...

Used in Bugs:

Usage:

./main.py Path [-v|-d] [--dryrun] [-h|--help] [-W] [-J Workers] [-I header_from_idl_folder]

Path => Path to the files you want to add MOZ_OVERRIDE

-v => Verbose Mode

-d => Debug Mode

--dryrun => Doesn't modify files, only simulation

-h => Obvious

-W => Shouldn't be used, unsafe

-J => Number of parallel workers used to parse and generate the database (be carreful, it's using processes so memory usage is very important)

-I idl_folder => Another path to parse files but thoses won't be modified very usefull if some of your classes in Path included files that aren't in the same folder

To get the best results, do this:

clean, configure and generates IDL files

~/m-c_folder>./mach clobber; ./mach configure && ./mach build export

Parse Files and annotate them.

~/>./main.py ~/m-c_folder/<module> -I ~/m-c_folder

This way you will generate all idl files, parse all headers used in m-c but only modify thoses in the you want.

Feel free to open an issue if needed or mail me for a quick question.

I'm sometimes present on IRC irc.mozilla.org #developers [:Six]

About

MozOverride is a mozilla CXX11 script that annotates mother-class overriding methods with MOZ_OVERRIDE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages