home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / h / vd2 / system / text.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  2.4 KB  |  61 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    System library component
  3. //    Copyright (C) 1998-2004 Avery Lee, All Rights Reserved.
  4. //
  5. //    Beginning with 1.6.0, the VirtualDub system library is licensed
  6. //    differently than the remainder of VirtualDub.  This particular file is
  7. //    thus licensed as follows (the "zlib" license):
  8. //
  9. //    This software is provided 'as-is', without any express or implied
  10. //    warranty.  In no event will the authors be held liable for any
  11. //    damages arising from the use of this software.
  12. //
  13. //    Permission is granted to anyone to use this software for any purpose,
  14. //    including commercial applications, and to alter it and redistribute it
  15. //    freely, subject to the following restrictions:
  16. //
  17. //    1.    The origin of this software must not be misrepresented; you must
  18. //        not claim that you wrote the original software. If you use this
  19. //        software in a product, an acknowledgment in the product
  20. //        documentation would be appreciated but is not required.
  21. //    2.    Altered source versions must be plainly marked as such, and must
  22. //        not be misrepresented as being the original software.
  23. //    3.    This notice may not be removed or altered from any source
  24. //        distribution.
  25.  
  26. #ifndef f_VD2_SYSTEM_TEXT_H
  27. #define f_VD2_SYSTEM_TEXT_H
  28.  
  29. #include <ctype.h>
  30. #include <stdarg.h>
  31.  
  32. class VDStringA;
  33. class VDStringW;
  34.  
  35. // The max_dst value needs to include space for the NULL as well.  The number
  36. // of characters produced is returned, minus the null terminator.
  37.  
  38. int VDTextWToA(char *dst, int max_dst, const wchar_t *src, int max_src = -1);
  39. int VDTextAToW(wchar_t *dst, int max_dst, const char *src, int max_src = -1);
  40.  
  41. VDStringA VDTextWToA(const wchar_t *src, int length = -1);
  42. VDStringA VDTextWToA(const VDStringW& sw);
  43. VDStringW VDTextAToW(const char *src, int length = -1);
  44. VDStringW VDTextAToW(const VDStringA& sw);
  45.  
  46. VDStringA VDTextWToU8(const VDStringW& s);
  47. VDStringA VDTextWToU8(const wchar_t *s, int length);
  48. VDStringW VDTextU8ToW(const VDStringA& s);
  49. VDStringW VDTextU8ToW(const char *s, int length);
  50.  
  51. // The terminating NULL character is not included in these.
  52.  
  53. int VDTextWToALength(const wchar_t *s, int length=-1);
  54. int VDTextAToWLength(const char *s, int length=-1);
  55.  
  56. VDStringW VDaswprintf(const wchar_t *format, int args, const void *const *argv);
  57. VDStringW VDvswprintf(const wchar_t *format, int args, va_list val);
  58. VDStringW VDswprintf(const wchar_t *format, int args, ...);
  59.  
  60. #endif
  61.