|
11 | 11 |
|
12 | 12 | namespace graphql::generator::client { |
13 | 13 |
|
14 | | -struct [[nodiscard]] GeneratorPaths |
| 14 | +struct [[nodiscard("unnecessary construction")]] GeneratorPaths |
15 | 15 | { |
16 | 16 | const std::string headerPath; |
17 | 17 | const std::string sourcePath; |
18 | 18 | }; |
19 | 19 |
|
20 | | -struct [[nodiscard]] GeneratorOptions |
| 20 | +struct [[nodiscard("unnecessary construction")]] GeneratorOptions |
21 | 21 | { |
22 | 22 | const GeneratorPaths paths; |
23 | 23 | const bool verbose = false; |
24 | 24 | }; |
25 | 25 |
|
26 | | -class [[nodiscard]] Generator |
| 26 | +class [[nodiscard("unnecessary construction")]] Generator |
27 | 27 | { |
28 | 28 | public: |
29 | 29 | // Initialize the generator with the introspection client or a custom GraphQL client. |
30 | | - explicit Generator( |
31 | | - SchemaOptions&& schemaOptions, RequestOptions&& requestOptions, GeneratorOptions&& options); |
| 30 | + explicit Generator(SchemaOptions && schemaOptions, |
| 31 | + RequestOptions && requestOptions, |
| 32 | + GeneratorOptions && options); |
32 | 33 |
|
33 | 34 | // Run the generator and return a list of filenames that were output. |
34 | | - [[nodiscard]] std::vector<std::string> Build() const noexcept; |
| 35 | + [[nodiscard("unnecessary memory copy")]] std::vector<std::string> Build() const noexcept; |
35 | 36 |
|
36 | 37 | private: |
37 | | - [[nodiscard]] std::string getHeaderDir() const noexcept; |
38 | | - [[nodiscard]] std::string getSourceDir() const noexcept; |
39 | | - [[nodiscard]] std::string getHeaderPath() const noexcept; |
40 | | - [[nodiscard]] std::string getSourcePath() const noexcept; |
41 | | - [[nodiscard]] const std::string& getClientNamespace() const noexcept; |
42 | | - [[nodiscard]] const std::string& getOperationNamespace( |
| 38 | + [[nodiscard("unnecessary memory copy")]] std::string getHeaderDir() const noexcept; |
| 39 | + [[nodiscard("unnecessary memory copy")]] std::string getSourceDir() const noexcept; |
| 40 | + [[nodiscard("unnecessary memory copy")]] std::string getHeaderPath() const noexcept; |
| 41 | + [[nodiscard("unnecessary memory copy")]] std::string getSourcePath() const noexcept; |
| 42 | + [[nodiscard("unnecessary call")]] const std::string& getClientNamespace() const noexcept; |
| 43 | + [[nodiscard("unnecessary call")]] const std::string& getOperationNamespace( |
43 | 44 | const Operation& operation) const noexcept; |
44 | | - [[nodiscard]] std::string getResponseFieldCppType( |
45 | | - const ResponseField& responseField, std::string_view currentScope = {}) const noexcept; |
| 45 | + [[nodiscard("unnecessary memory copy")]] std::string getResponseFieldCppType( |
| 46 | + const ResponseField& responseField, |
| 47 | + std::string_view currentScope = {}) const noexcept; |
46 | 48 |
|
47 | | - [[nodiscard]] bool outputHeader() const noexcept; |
48 | | - void outputRequestComment(std::ostream& headerFile) const noexcept; |
49 | | - void outputGetRequestDeclaration(std::ostream& headerFile) const noexcept; |
50 | | - void outputGetOperationNameDeclaration(std::ostream& headerFile) const noexcept; |
51 | | - [[nodiscard]] bool outputResponseFieldType(std::ostream& headerFile, |
52 | | - const ResponseField& responseField, size_t indent = 0) const noexcept; |
| 49 | + [[nodiscard("unnecessary call")]] bool outputHeader() const noexcept; |
| 50 | + void outputRequestComment(std::ostream & headerFile) const noexcept; |
| 51 | + void outputGetRequestDeclaration(std::ostream & headerFile) const noexcept; |
| 52 | + void outputGetOperationNameDeclaration(std::ostream & headerFile) const noexcept; |
| 53 | + [[nodiscard("unnecessary call")]] bool outputResponseFieldType(std::ostream & headerFile, |
| 54 | + const ResponseField& responseField, |
| 55 | + size_t indent = 0) const noexcept; |
53 | 56 |
|
54 | | - [[nodiscard]] bool outputSource() const noexcept; |
55 | | - void outputGetRequestImplementation(std::ostream& sourceFile) const noexcept; |
56 | | - void outputGetOperationNameImplementation( |
57 | | - std::ostream& sourceFile, const Operation& operation) const noexcept; |
58 | | - bool outputModifiedResponseImplementation(std::ostream& sourceFile, |
59 | | - const std::string& outerScope, const ResponseField& responseField) const noexcept; |
60 | | - [[nodiscard]] static std::string getTypeModifierList( |
| 57 | + [[nodiscard("unnecessary call")]] bool outputSource() const noexcept; |
| 58 | + void outputGetRequestImplementation(std::ostream & sourceFile) const noexcept; |
| 59 | + void outputGetOperationNameImplementation(std::ostream & sourceFile, const Operation& operation) |
| 60 | + const noexcept; |
| 61 | + bool outputModifiedResponseImplementation(std::ostream & sourceFile, |
| 62 | + const std::string& outerScope, |
| 63 | + const ResponseField& responseField) const noexcept; |
| 64 | + [[nodiscard("unnecessary memory copy")]] static std::string getTypeModifierList( |
61 | 65 | const TypeModifierStack& modifiers) noexcept; |
62 | 66 |
|
63 | 67 | const SchemaLoader _schemaLoader; |
|
0 commit comments