Lines Matching refs:std
19 explicit TemplateParameter(std::string name) : name(std::move(name)) {}
20 TemplateParameter(std::string type, std::string name)
21 : name(std::move(name)), type(std::move(type)) {}
23 std::string name;
24 std::string type;
29 explicit Class(std::string name) : name_(std::move(name)) {}
30 Class(std::vector<TemplateParameter> template_parameters, std::string name)
31 : template_parameters_(std::move(template_parameters)),
32 name_(std::move(name)) {}
34 std::string GetName() const { return name_; }
35 std::vector<TemplateParameter> GetTemplateParameters() const {
40 std::vector<TemplateParameter> template_parameters_;
41 std::string name_;
62 std::string type;
63 std::string name;
64 std::string default_value;
66 Parameter(std::string type, std::string name,
67 std::string default_value = {})
68 : type(std::move(type)),
69 name(std::move(name)),
70 default_value(std::move(default_value)) {}
73 explicit Function(std::string name)
76 name_(std::move(name)) {}
77 Function(Class* owning_class, std::string name)
80 name_(std::move(name)) {}
83 static Function DefaultGetter(std::string return_type, Class* owner,
84 std::string name) {
85 Function getter(owner, std::move(name));
86 getter.SetReturnType(std::move(return_type));
92 static Function DefaultSetter(Class* owner, std::string name,
93 std::string parameter_type,
94 std::string parameter_name) {
95 Function setter(owner, std::move(name));
97 setter.AddParameter(std::move(parameter_type), std::move(parameter_name));
123 void SetDescription(std::string description) {
124 description_ = std::move(description);
126 void SetName(std::string name) { name_ = std::move(name); }
127 void SetReturnType(std::string return_type) {
128 return_type_ = std::move(return_type);
130 void AddParameter(std::string type, std::string name = {},
131 std::string default_value = {}) {
132 parameters_.emplace_back(std::move(type), std::move(name),
133 std::move(default_value));
135 void InsertParameter(int index, std::string type, std::string name = {},
136 std::string default_value = {}) {
141 Parameter(std::move(type), std::move(name), std::move(default_value)));
143 std::vector<Parameter> GetParameters() const { return parameters_; }
144 std::vector<std::string> GetParameterNames() const {
145 std::vector<std::string> names;
146 std::transform(parameters_.begin(), parameters_.end(),
147 std::back_inserter(names),
153 void PrintDeclaration(std::ostream& stream,
155 void PrintDefinition(std::ostream& stream,
156 const std::function<void(std::ostream&)>& builder,
158 void PrintInlineDefinition(std::ostream& stream,
159 const std::function<void(std::ostream&)>& builder,
161 void PrintBeginDefinition(std::ostream& stream, int indentation = 0) const;
162 void PrintEndDefinition(std::ostream& stream, int indentation = 0) const;
165 void PrintDeclarationHeader(std::ostream& stream, int indentation) const;
170 std::string description_;
171 std::string name_;
172 std::string return_type_;
173 std::vector<Parameter> parameters_;
182 explicit File(std::ostream& stream) : stream_(&stream) {}
184 void BeginIncludeGuard(const std::string& name);
185 void EndIncludeGuard(const std::string& name);
186 void BeginNamespace(std::string name);
187 void BeginNamespace(std::string name0, std::string name1);
188 void EndNamespace(const std::string& name);
189 void EndNamespace(const std::string& name0, const std::string& name1);
191 void AddInclude(std::string include) { includes_.insert(std::move(include)); }
200 std::ostream& s() { return *stream_; }
203 std::ostream* stream_;
204 std::set<std::string> includes_;
205 std::stack<std::string> namespaces_;
210 explicit IncludeGuardScope(File* file, std::string name)
211 : file_(file), name_(std::move(name)) {
217 std::swap(file_, other.file_);
218 std::swap(name_, other.name_);
230 std::swap(file_, other.file_);
231 std::swap(name_, other.name_);
238 std::string name_;