libcm is a C development framework with an emphasis on audio signal processing applications.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

cmTextTemplate.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef cmTextTemplate_h
  2. #define cmTextTemplate_h
  3. enum
  4. {
  5. kOkTtRC = cmOkRC,
  6. kFileFailTtRC,
  7. kLHeapFailTtRC,
  8. kSyntaxErrTtRC,
  9. kFindFailTtRC,
  10. kInvalidTypeTtRC,
  11. kJsonFailTtRC
  12. };
  13. typedef cmHandle_t cmTtH_t;
  14. typedef unsigned cmTtRC_t;
  15. extern cmTtH_t cmTtNullHandle;
  16. // Initialize a template file.
  17. cmTtRC_t cmTextTemplateInitialize( cmCtx_t* ctx, cmTtH_t* hp, const cmChar_t* fn );
  18. // Finalize a template file
  19. cmTtRC_t cmTextTemplateFinalize( cmTtH_t* hp );
  20. // Return true if the template file is intialized.
  21. bool cmTextTemplateIsValid( cmTtH_t h );
  22. // Set the value of a template variable.
  23. // The node identified by { label,index, label, index ... } must
  24. // be a variable node. The function will fail if a 'set' or 'text' node
  25. // is identified.
  26. // Set 'value' to NULL to erase a previously set value.
  27. cmTtRC_t cmTextTemplateSetValue( cmTtH_t h, const cmChar_t* value, const cmChar_t* label, unsigned index, ... );
  28. // Create a copy of the sub-tree identified by the variable path
  29. // and insert it as the left sibling of the sub-tree's root.
  30. cmTtRC_t cmTextTemplateRepeat( cmTtH_t h, const cmChar_t* label, unsigned index, ... );
  31. // Write the template file.
  32. cmTtRC_t cmTextTemplateWrite( cmTtH_t h, const cmChar_t* fn );
  33. // Apply a template value JSON file to this template
  34. cmTtRC_t cmTextTemplateApply( cmTtH_t h, const cmChar_t* fn );
  35. // Print an annotated template tree.
  36. void cmTtPrintTree( cmTtH_t h, cmRpt_t* rpt );
  37. cmTtRC_t cmTextTemplateTest( cmCtx_t* ctx, const cmChar_t* fn );
  38. #endif