Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
istraux.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 4k
Category:
Windows Kernel
Development Platform:
Visual C++
- /*****************************************************************/
- /** Microsoft Windows for Workgroups **/
- /** Copyright (C) Microsoft Corp., 1991-1992 **/
- /*****************************************************************/
- /*
- istraux.cpp
- NLS/DBCS-aware string class: secondary methods of index class
- This file contains the implementation of the auxiliary methods
- for the ISTR class. It is separate so that clients of STRING which
- do not use this operator need not link to it.
- FILE HISTORY:
- beng 01/18/91 Separated from original monolithic .cxx
- beng 02/07/91 Uses lmui.hxx
- beng 04/26/91 Relocated some funcs from string.hxx
- gregj 03/25/93 Ported to Chicago environment
- gregj 04/02/93 Use NLS_STR::IsDBCSLeadByte()
- */
- #include "npcommon.h"
- extern "C"
- {
- #include <netlib.h>
- }
- #if defined(DEBUG)
- static const CHAR szFileName[] = __FILE__;
- #define _FILENAME_DEFINED_ONCE szFileName
- #endif
- #include <npassert.h>
- #include <npstring.h>
- /*******************************************************************
- NAME: ISTR::Reset
- SYNOPSIS: Reset the ISTR so the index is 0;
- updates the version number of the string.
- ENTRY:
- EXIT:
- NOTES:
- HISTORY:
- Johnl 11/28/90 Created
- ********************************************************************/
- VOID ISTR::Reset()
- {
- _ibString = 0;
- #ifdef DEBUG
- _usVersion = QueryPNLS()->QueryVersion();
- #endif
- }
- /*******************************************************************
- NAME: ISTR::operator-
- SYNOPSIS: Returns the difference in CB between the two ISTR
- ENTRY:
- EXIT:
- NOTES:
- HISTORY:
- Johnl 11/28/90 Created
- ********************************************************************/
- INT ISTR::operator-( const ISTR& istr2 ) const
- {
- UIASSERT( QueryPNLS() == istr2.QueryPNLS() );
- return ( QueryIB() - istr2.QueryIB() );
- }
- /*******************************************************************
- NAME: ISTR::operator++
- SYNOPSIS: Increment the ISTR to the next logical character
- ENTRY:
- EXIT:
- NOTES: Stops if we are at the end of the string
- HISTORY:
- Johnl 11/28/90 Created
- beng 07/23/91 Simplified CheckIstr
- ********************************************************************/
- ISTR& ISTR::operator++()
- {
- QueryPNLS()->CheckIstr( *this );
- CHAR c = *(QueryPNLS()->QueryPch() + QueryIB());
- if ( c != '' )
- {
- SetIB( QueryIB() + (QueryPNLS()->IsDBCSLeadByte(c) ? 2 : 1) );
- }
- return *this;
- }
- /*******************************************************************
- NAME: ISTR::operator+=
- SYNOPSIS: Increment the ISTR to the nth logical character
- NOTES: Stops if we are at the end of the string
- HISTORY:
- Johnl 01/14/90 Created
- ********************************************************************/
- VOID ISTR::operator+=( INT iChars )
- {
- while ( iChars-- )
- operator++();
- }
- /*******************************************************************
- NAME: ISTR::operator==
- SYNOPSIS: Equality operator
- RETURNS: TRUE if the two ISTRs are equivalent.
- NOTES: Only valid between two ISTRs of the same string.
- HISTORY:
- beng 07/22/91 Header added
- ********************************************************************/
- BOOL ISTR::operator==( const ISTR& istr ) const
- {
- UIASSERT( QueryPNLS() == istr.QueryPNLS() );
- return QueryIB() == istr.QueryIB();
- }
- /*******************************************************************
- NAME: ISTR::operator>
- SYNOPSIS: Greater-than operator
- RETURNS: TRUE if this ISTR points further into the string
- than the argument.
- NOTES: Only valid between two ISTRs of the same string.
- HISTORY:
- beng 07/22/91 Header added
- ********************************************************************/
- BOOL ISTR::operator>( const ISTR& istr ) const
- {
- UIASSERT( QueryPNLS() == istr.QueryPNLS() );
- return QueryIB() > istr.QueryIB();
- }
- /*******************************************************************
- NAME: ISTR::operator<
- SYNOPSIS: Lesser-than operator
- RETURNS: TRUE if this ISTR points less further into the string
- than the argument.
- NOTES: Only valid between two ISTRs of the same string.
- HISTORY:
- beng 07/22/91 Header added
- ********************************************************************/
- BOOL ISTR::operator<( const ISTR& istr ) const
- {
- UIASSERT( QueryPNLS() == istr.QueryPNLS() );
- return QueryIB() < istr.QueryIB();
- }