/[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 199 by ph10, Tue Jul 31 14:39:09 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 52  Line 52 
52    
53  #include <pcre.h>  #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 {
# Line 68  class PCRECPP_EXP_DEFN StringPiece { Line 70  class PCRECPP_EXP_DEFN 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.199  
changed lines
  Added in v.580

  ViewVC Help
Powered by ViewVC 1.1.5