ooUtils.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2004-2005 by Objective Systems, Inc.
  3. *
  4. * This software is furnished under an open source license and may be
  5. * used and copied only in accordance with the terms of this license.
  6. * The text of the license may generally be found in the root
  7. * directory of this installation in the COPYING file. It
  8. * can also be viewed online at the following URL:
  9. *
  10. * http://www.obj-sys.com/open/license.html
  11. *
  12. * Any redistributions of this file including modified versions must
  13. * maintain this copyright notice.
  14. *
  15. *****************************************************************************/
  16. /**
  17. * @file ooUtils.h
  18. * This file contains general utility functions.
  19. */
  20. #ifndef _OOUTILS_H_
  21. #define _OOUTILS_H_
  22. #include "ootypes.h"
  23. /**
  24. * Get text from a text table for a given enumeration index.
  25. *
  26. * @param idx Index of item in table
  27. * @param table The table containing the text items
  28. * @param tabsiz Number of items in the table
  29. * @return Text for item or '?' if idx outside bounds of table
  30. */
  31. EXTERN const char* ooUtilsGetText
  32. (OOUINT32 idx, const char** table, size_t tabsiz);
  33. /**
  34. * Test if given string value is empty. String is considered to empty
  35. * if value is NULL or there are no characters in string (strlen == 0).
  36. *
  37. * @param str String to test
  38. * @return TRUE if string empty; FALSE otherwise
  39. */
  40. EXTERN OOBOOL ooUtilsIsStrEmpty (const char * str);
  41. /**
  42. * Test if given string value is digit string.
  43. *
  44. * @param str String to test
  45. * @return TRUE if string contains all digits; FALSE otherwise
  46. */
  47. EXTERN OOBOOL ooIsDailedDigit(const char* str);
  48. #endif