| 1 | <?php |
| 2 | |
| 3 | namespace Dpp; |
| 4 | |
| 5 | /** |
| 6 | * Represents a header/cpp generator used to auto-generate cpp/.h files. |
| 7 | */ |
| 8 | interface StructGeneratorInterface |
| 9 | { |
| 10 | /** |
| 11 | * Generate the start of the header file |
| 12 | * |
| 13 | * @return string header content |
| 14 | */ |
| 15 | public function generateHeaderStart(): string; |
| 16 | |
| 17 | /** |
| 18 | * Generate the start of the cpp file |
| 19 | * |
| 20 | * @return string cpp content |
| 21 | */ |
| 22 | public function generateCppStart(): string; |
| 23 | |
| 24 | /** |
| 25 | * Check if the script should run and re-generate content or not |
| 26 | * |
| 27 | * @return string true if the script should run, false to exit |
| 28 | */ |
| 29 | public function checkForchanges(): bool; |
| 30 | |
| 31 | /** |
| 32 | * Generate header definition for a function |
| 33 | * |
| 34 | * @param string $returnType Return type of function |
| 35 | * @param string $currentFunction Current function name |
| 36 | * @param string $parameters Current function parameters with default values |
| 37 | * @param string $noDefaults Current function parameters without default values |
| 38 | * @param string $parameterNames Parameter names only |
| 39 | * @return string header content to append |
| 40 | */ |
| 41 | public function generateHeaderDef(string $returnType, string $currentFunction, string $parameters, string $noDefaults, string $parameterTypes, string $parameterNames): string; |
| 42 | |
| 43 | /** |
| 44 | * Generate cpp definition for a function |
| 45 | * |
| 46 | * @param string $returnType Return type of function |
| 47 | * @param string $currentFunction Current function name |
| 48 | * @param string $parameters Current function parameters with default values |
| 49 | * @param string $noDefaults Current function parameters without default values |
| 50 | * @param string $parameterNames Parameter names only |
| 51 | * @return string cpp content to append |
| 52 | */ |
| 53 | public function generateCppDef(string $returnType, string $currentFunction, string $parameters, string $noDefaults, string $parameterTypes, string $parameterNames): string; |
| 54 | |
| 55 | /** |
| 56 | * Return comment lines to add to each header definition |
| 57 | * |
| 58 | * @return array Comment lines to add |
| 59 | */ |
| 60 | public function getCommentArray(): array; |
| 61 | |
| 62 | /** |
| 63 | * Save the .h file |
| 64 | * |
| 65 | * @param string $content Content to save |
| 66 | */ |
| 67 | public function saveHeader(string $content): void; |
| 68 | |
| 69 | /** |
| 70 | * Save the .cpp file |
| 71 | * |
| 72 | * @param string $cppcontent Content to save |
| 73 | */ |
| 74 | public function saveCpp(string $cppcontent): void; |
| 75 | }; |