def run(self, edit): regions = [] for reg in self.view.sel(): reg = selectFullLines(self.view, reg) lines = [] for rawLine in self.view.substr(reg).split("\n"): args = parseMember(rawLine, GetSetStyle) if args: lines.append(HppGetSetTemplate % args) regions.append((reg, "\n".join(lines))) for reg, lin in reversed(regions): self.view.replace(edit, reg, lin)
def parseLine(self, line): stripped = line.strip() if not stripped: return "" if stripped[0] == "@": tempSpec, name, tempArgs = parseClassName( stripped, self.className, self.defaultClassName) self.templateSpec = tempSpec and tempSpec + "\n" self.className = name self.completeClassName = name and name + tempArgs + "::" else: props = parseMember(line, self.style) if props: props["class"] = self.completeClassName props["template"] = self.templateSpec return CppGetSetTemplate % props return ""