IUTF8String.h
Go to the documentation of this file.
1 #ifndef __IUTF8String_h__
2 #define __IUTF8String_h__ 1
3 
4 // =================================================================================================
5 // Copyright 2014 Adobe Systems Incorporated
6 // All Rights Reserved.
7 //
8 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
9 // of the Adobe license agreement accompanying it.
10 // =================================================================================================
11 
14 
15 namespace AdobeXMPCommon {
17 
24  : public virtual ISharedObject
25  , public virtual IVersionable
26  {
27  public:
36  virtual spIUTF8String APICALL append( const char * buf, sizet count ) = 0;
37 
51  virtual spIUTF8String APICALL append( const spcIUTF8String & src, sizet srcPos = 0, sizet count = npos ) = 0;
52 
61  virtual spIUTF8String APICALL assign( const char * buf, sizet count ) = 0;
62 
76  virtual spIUTF8String APICALL assign( const spcIUTF8String & src, sizet srcPos = 0, sizet count = npos ) = 0;
77 
89  virtual spIUTF8String APICALL insert( sizet pos, const char * buf, sizet count ) = 0;
90 
107  virtual spIUTF8String APICALL insert( sizet pos, const spcIUTF8String & src, sizet srcPos = 0, sizet count = npos ) = 0;
108 
119  virtual spIUTF8String APICALL erase( sizet pos = 0, sizet count = npos ) = 0;
120 
132  virtual void APICALL resize( sizet n ) = 0 ;
133 
147  virtual spIUTF8String APICALL replace( sizet pos, sizet count, const char * buf, sizet srcCount ) = 0;
148 
164  virtual spIUTF8String APICALL replace( sizet pos, sizet count, const spcIUTF8String & src, sizet srcPos = 0, sizet srcCount = npos ) = 0;
165 
180  virtual sizet APICALL copy( char * buf, sizet len, sizet pos = 0 ) const = 0;
181 
194  sizet find( const char * buf, sizet pos = 0 ) const {
195  return find( buf, pos, npos );
196  }
197 
211  virtual sizet APICALL find( const char * buf, sizet pos, sizet count ) const = 0;
212 
213 
214  //
227  virtual sizet APICALL find( const spcIUTF8String & src, sizet pos = 0, sizet count = npos ) const = 0;
228 
230  // @{
243  sizet rfind( const char * buf, sizet pos = npos ) const {
244  return rfind( buf, pos, npos );
245  }
246  virtual sizet APICALL rfind( const char * buf, sizet pos, sizet count ) const = 0;
248 
264  virtual sizet APICALL rfind( const spcIUTF8String & src, sizet pos = npos, sizet count = npos ) const = 0;
265 
283  int32 compare( const char * buf ) const {
284  return compare( 0, size(), buf, npos );
285  }
305  int32 compare( sizet pos, sizet len, const char * buf ) const {
306  return compare( pos, len, buf, npos );
307  }
328  virtual int32 APICALL compare( sizet pos, sizet len, const char * buf, sizet count ) const = 0;
329 
330 
347  int32 compare( const spcIUTF8String & str ) const {
348  return compare( 0, size(), str, 0, str->size() );
349  }
372  virtual int32 APICALL compare( sizet pos, sizet len, const spcIUTF8String & str, sizet strPos = 0, sizet strLen = npos ) const = 0;
373 
385  virtual spIUTF8String APICALL substr( sizet pos = 0, sizet count = npos ) const = 0;
386 
391  virtual bool APICALL empty() const = 0;
392 
397  virtual const char * APICALL c_str() const __NOTHROW__ = 0;
398 
402  virtual void APICALL clear() __NOTHROW__ = 0;
403 
408  virtual sizet APICALL size() const __NOTHROW__ = 0;
409 
416  virtual pIUTF8String APICALL GetActualIUTF8String() __NOTHROW__ = 0;
417  XMP_PRIVATE pcIUTF8String GetActualIUTF8String() const __NOTHROW__ {
418  return const_cast< IUTF8String_v1 * >( this )->GetActualIUTF8String();
419  }
422 
429  XMP_PRIVATE static spIUTF8String MakeShared( pIUTF8String_base ptr );
430  XMP_PRIVATE static spcIUTF8String MakeShared( pcIUTF8String_base ptr ) {
431  return MakeShared( const_cast< pIUTF8String_base >( ptr ) );
432  }
435 
440  XMP_PRIVATE static uint64 GetInterfaceID() { return kIUTF8StringID; }
441 
446  XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
448 
449  // static factory functions
450 
456  XMP_PRIVATE static spIUTF8String CreateUTF8String( pIObjectFactory objFactory );
457 
467  XMP_PRIVATE static spIUTF8String CreateUTF8String( pIObjectFactory objFactory, const char * buf, sizet count );
468 
469  protected:
473  virtual ~IUTF8String_v1() __NOTHROW__ {}
474 
476  virtual pIUTF8String_base APICALL assign( const char * buffer, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
477  virtual pIUTF8String_base APICALL assign( pcIUTF8String_base str, sizet srcPos, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
478  virtual pIUTF8String_base APICALL append( const char * buffer, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
479  virtual pIUTF8String_base APICALL append( pcIUTF8String_base str, sizet srcPos, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
480  virtual pIUTF8String_base APICALL insert( sizet pos, const char * buf, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
481  virtual pIUTF8String_base APICALL insert( sizet pos, pcIUTF8String_base src, sizet srcPos, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
482  virtual pIUTF8String_base APICALL erase( sizet pos, sizet count, pcIError_base & error ) __NOTHROW__ = 0;
483  virtual void APICALL resize( sizet n, pcIError_base & error ) __NOTHROW__ = 0;
484  virtual pIUTF8String_base APICALL replace( sizet pos, sizet count, const char * buf, sizet srcCount, pcIError_base & error ) __NOTHROW__ = 0;
485  virtual pIUTF8String_base APICALL replace( sizet pos, sizet count, pcIUTF8String_base src, sizet srcPos, sizet srcCount, pcIError_base & error ) __NOTHROW__ = 0;
486  virtual sizet APICALL copy( char * buf, sizet len, sizet pos, pcIError_base & error ) const __NOTHROW__ = 0;
487  virtual sizet APICALL find( const char * buf, sizet pos, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
488  virtual sizet APICALL find( pcIUTF8String_base src, sizet pos, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
489  virtual sizet APICALL rfind( const char * buf, sizet pos, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
490  virtual sizet APICALL rfind( pcIUTF8String_base src, sizet pos, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
491  virtual int32 APICALL compare( sizet pos, sizet len, const char * buf, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
492  virtual int32 APICALL compare( sizet pos, sizet len, pcIUTF8String_base str, sizet strPos, sizet strLen, pcIError_base & error ) const __NOTHROW__ = 0;
493  virtual pIUTF8String_base APICALL substr( sizet pos, sizet count, pcIError_base & error ) const __NOTHROW__ = 0;
494  virtual uint32 APICALL empty( pcIError_base & error ) const __NOTHROW__ = 0;
495 
496  #ifdef FRIEND_CLASS_DECLARATION
497  FRIEND_CLASS_DECLARATION();
498  #endif
501  };
502 }
503 
504 #endif // __IUTF8String_h__
int32 compare(sizet pos, sizet len, const char *buf) const
Compare strings.
Definition: IUTF8String.h:305
const sizet npos(kMaxSize)
#define XMP_PUBLIC
#define __NOTHROW__
virtual ~IUTF8String_v1() __NOTHROW__
Definition: IUTF8String.h:473
shared_ptr< const IUTF8String > spcIUTF8String
sizet find(const char *buf, sizet pos=0) const
Find content in string.
Definition: IUTF8String.h:194
IUTF8String * pIUTF8String
const IUTF8String * pcIUTF8String
Version1 of the interface that represents an error/warning encountered during processing.
Definition: IError.h:26
sizet rfind(const char *buf, sizet pos=npos) const
Find last occurrence of content in string.
Definition: IUTF8String.h:243
Interface that serves as the base interface of all the externally exposed interfaces.
Definition: ISharedObject.h:27
int32 compare(const spcIUTF8String &str) const
Compare strings.
Definition: IUTF8String.h:347
IObjectFactory * pIObjectFactory
#define REQ_FRIEND_CLASS_DECLARATION()
int32 compare(const char *buf) const
Compare strings.
Definition: IUTF8String.h:283
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IVersionable.h:28
#define XMP_PRIVATE
Version1 of the interface that represents an UTF8String.
Definition: IUTF8String.h:23
shared_ptr< IUTF8String > spIUTF8String
static const uint64 kIUTF8StringID(0x6e55544638537472)

XMPToolkit documentation generated by doxygen 1.8.11