CGEchoStandard.m 794 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /******************************************************************
  2. *
  3. * uEcho for ObjC
  4. *
  5. * Copyright (C) Satoshi Konno 2015
  6. *
  7. * This is licensed under BSD-style license, see file COPYING.
  8. *
  9. ******************************************************************/
  10. #import "CGEchoStandard.h"
  11. #include <uecho/std/database.h>
  12. @implementation CGEchoDatabase {
  13. uEchoDatabase* cObject;
  14. }
  15. - (id)init
  16. {
  17. if ((self = [super init]) == nil)
  18. return nil;
  19. cObject = uecho_standard_getdatabase();
  20. return self;
  21. }
  22. - (void)dealloc
  23. {
  24. }
  25. - (NSString*)findManufactureName:(int)code
  26. {
  27. if (!cObject)
  28. return nil;
  29. uEchoManufacture* man = uecho_database_getmanufacture(cObject, code);
  30. if (!man)
  31. return nil;
  32. return [NSString stringWithUTF8String:uecho_manufacture_getname(man)];
  33. }
  34. @end