/[pcre]/code/trunk/pcre_stringpiece.h.in
ViewVC logotype

Diff of /code/trunk/pcre_stringpiece.h.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 96 by nigel, Fri Mar 2 13:10:43 2007 UTC revision 580 by ph10, Fri Nov 26 11:16:43 2010 UTC
# Line 38  Line 38 
38  #ifndef _PCRE_STRINGPIECE_H  #ifndef _PCRE_STRINGPIECE_H
39  #define _PCRE_STRINGPIECE_H  #define _PCRE_STRINGPIECE_H
40    
41  #include <string.h>  #include <cstring>
42  #include <string>  #include <string>
43  #include <iosfwd>    // for ostream forward-declaration  #include <iosfwd>    // for ostream forward-declaration
44    
# Line 50  Line 50 
50  #include <bits/type_traits.h>  #include <bits/type_traits.h>
51  #endif  #endif
52    
53    #include <pcre.h>
54    
55    using std::memcmp;
56    using std::strlen;
57  using std::string;  using std::string;
58    
59  namespace pcrecpp {  namespace pcrecpp {
60    
61  class StringPiece {  class PCRECPP_EXP_DEFN StringPiece {
62   private:   private:
63    const char*   ptr_;    const char*   ptr_;
64    int           length_;    int           length_;
# Line 66  class StringPiece { Line 70  class StringPiece {
70    StringPiece()    StringPiece()
71      : ptr_(NULL), length_(0) { }      : ptr_(NULL), length_(0) { }
72    StringPiece(const char* str)    StringPiece(const char* str)
73      : ptr_(str), length_(static_cast<int>(strlen(str))) { }      : ptr_(str), length_(static_cast<int>(strlen(ptr_))) { }
74      StringPiece(const unsigned char* str)
75        : ptr_(reinterpret_cast<const char*>(str)),
76          length_(static_cast<int>(strlen(ptr_))) { }
77    StringPiece(const string& str)    StringPiece(const string& str)
78      : ptr_(str.data()), length_(static_cast<int>(str.size())) { }      : ptr_(str.data()), length_(static_cast<int>(str.size())) { }
79    StringPiece(const char* offset, int len)    StringPiece(const char* offset, int len)

Legend:
Removed from v.96  
changed lines
  Added in v.580

  ViewVC Help
Powered by ViewVC 1.1.5