impl_tagz.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "impl_tagz.h"
  2. #include "tagz.h"
  3. #include "api__tagz.h"
  4. #include "resource.h"
  5. int Tagz::Format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters)
  6. {
  7. VarList vars;
  8. FMT formatter;
  9. formatter.Open(spec, tagProvider, parameters, &vars);
  10. wchar_t *zz = formatter;
  11. if (zz)
  12. {
  13. lstrcpyn(out, zz, (int)outCch);
  14. free(zz);
  15. }
  16. else
  17. {
  18. memset(out, 0, (int)outCch);
  19. }
  20. return TAGZ_SUCCESS;
  21. }
  22. char *Tagz::Manual()
  23. {
  24. return (char*)WASABI_API_LOADRESFROMFILEW(L"TEXT", MAKEINTRESOURCE(IDR_TAGZ_TEXT), 0);
  25. }
  26. void Tagz::SetVariable(const wchar_t *name, const wchar_t *value)
  27. {
  28. /*vars.Put(name, value);*/
  29. }
  30. int Tagz::GetVariable(const wchar_t *name, wchar_t *value, size_t valueLen)
  31. {
  32. return TAGZ_FAILURE;
  33. /*
  34. wchar_t *val = vars.Get(name);
  35. if (!val)
  36. return TAGZ_UNDEFINED_VARIABLE;
  37. lstrcpynW(value, val, (int)valueLen);
  38. return TAGZ_SUCCESS;
  39. */
  40. }
  41. #ifdef CBCLASS
  42. #undef CBCLASS
  43. #endif
  44. #define CBCLASS Tagz
  45. START_DISPATCH;
  46. CB(API_TAGZ_FORMAT, Format)
  47. CB(API_TAGZ_HELP_STRING, Manual)
  48. VCB(API_TAGZ_SET_VARIABLE, SetVariable)
  49. END_DISPATCH;