Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
1.9 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows for Workgroups **/
  3. /** Copyright (C) Microsoft Corp., 1991-1992 **/
  4. /*****************************************************************/
  5. /*
  6. istr.cxx
  7. NLS/DBCS-aware string class: string index class
  8. This file contains the core implementation of the string
  9. indexer class.
  10. FILE HISTORY:
  11. gregj 03/30/93 Removed ISTR to separate module
  12. */
  13. #include "npcommon.h"
  14. extern "C"
  15. {
  16. #include <netlib.h>
  17. }
  18. #if defined(DEBUG)
  19. static const CHAR szFileName[] = __FILE__;
  20. #define _FILENAME_DEFINED_ONCE szFileName
  21. #endif
  22. #include <npassert.h>
  23. #include <npstring.h>
  24. /*******************************************************************
  25. NAME: ISTR::ISTR
  26. SYNOPSIS: ISTR construction methods
  27. ENTRY:
  28. ISTR::ISTR( ISTR& ) - Copy passed ISTR (both string and positional
  29. info is copied).
  30. ISTR::ISTR( IB, NLS_STR& ) - Private, create an ISTR with index
  31. at IB for string NLS_STR
  32. EXIT:
  33. NOTES:
  34. HISTORY:
  35. johnl 11/20/90 Created
  36. ********************************************************************/
  37. ISTR::ISTR( const ISTR& istr )
  38. {
  39. *this = istr;
  40. }
  41. ISTR::ISTR( const NLS_STR& nls )
  42. {
  43. *this = nls;
  44. }
  45. /*******************************************************************
  46. NAME: ISTR::operator=
  47. SYNOPSIS: Copy operator for the ISTR class
  48. ENTRY:
  49. EXIT:
  50. NOTES:
  51. HISTORY:
  52. Johnl 11/20/90 Created
  53. gregj 03/30/93 Allow assignment of NLS_STR to ISTR
  54. ********************************************************************/
  55. ISTR& ISTR::operator=( const ISTR& istr )
  56. {
  57. _ibString = istr._ibString;
  58. SetPNLS( (NLS_STR *) istr.QueryPNLS() );
  59. #ifdef DEBUG
  60. _usVersion = istr._usVersion;
  61. #endif
  62. return *this;
  63. }
  64. ISTR& ISTR::operator=( const NLS_STR& nls )
  65. {
  66. _ibString = 0;
  67. SetPNLS( &nls );
  68. #ifdef DEBUG
  69. _usVersion = nls.QueryVersion();
  70. #endif
  71. return *this;
  72. }