6,566
edits
(→Script: Improved the staticSubsystemClassId() parsing.) |
|||
Line 131: | Line 131: | ||
ctor = "\<%s\>::\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ctor = "\<%s\>::\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ||
dtor = "\<%s\>::\~\<%s\>[ \(]" % (subsystem.name, subsystem.name) | dtor = "\<%s\>::\~\<%s\>[ \(]" % (subsystem.name, subsystem.name) | ||
grep_ctor = 'grep -rI "%s\ | grep_ctor = 'grep -rI "%s\|%s"' % (ctor, dtor) | ||
# The grep command for any function implementation. | # The grep command for any function implementation. | ||
Line 145: | Line 145: | ||
cmds = [ | cmds = [ | ||
'%s %s' % (grep_ctor, full_path), | '%s %s' % (grep_ctor, full_path), | ||
'%s %s | '%s %s | grep -v "return"' % (grep_any, full_path) | ||
] | ] | ||
Line 161: | Line 161: | ||
cmds = [ | cmds = [ | ||
'cd %s; %s' % (path, grep_ctor), | 'cd %s; %s' % (path, grep_ctor), | ||
'cd %s; %s | 'cd %s; %s | grep -v "return"' % (path, grep_any) | ||
] | ] | ||
Line 310: | Line 310: | ||
# The Unix grep command to run. | # The Unix grep command to run. | ||
if simgear: | if simgear: | ||
cmd = 'cd %s; grep -rI %s "public \<%s\>\ | cmd = 'cd %s; grep -rI %s "public \<%s\>\|public simgear.*::\<%s\>" | grep -v "%s::"' % (path, self.grep_exclude_dir, base_name, base_name, base_name) | ||
else: | else: | ||
cmd = 'cd %s; grep -rI %s "public \<%s\>" | cmd = 'cd %s; grep -rI %s "public \<%s\>" | grep -v "%s::"' % (path, self.grep_exclude_dir, base_name, base_name) | ||
pipe = Popen(cmd, shell=True, stdout=PIPE) | pipe = Popen(cmd, shell=True, stdout=PIPE) | ||
Line 779: | Line 779: | ||
# Loop over the file contents. | # Loop over the file contents. | ||
in_decl = False | |||
for i in range(len(lines)): | for i in range(len(lines)): | ||
# The start of the declaration. | |||
if search("^class %s : " % self.name, lines[i]): | |||
in_decl = True | |||
continue | |||
# Skip the line. | |||
if not in_decl: | |||
continue | |||
# Out of the declaration. | |||
if search("^};", lines[i]): | |||
in_decl = False | |||
continue | |||
# The static subsystem class ID. | # The static subsystem class ID. | ||
if search("static const char\* staticSubsystemClassId()", lines[i]): | if search("static const char\* staticSubsystemClassId()", lines[i]): |