Psyduck - 可達鴨 之 鴨力山大2


Server : LiteSpeed
System : Linux premium217.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : alloknri ( 880)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /usr/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/include/pcre_stringpiece.h
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: Sanjay Ghemawat
//
// A string like object that points into another piece of memory.
// Useful for providing an interface that allows clients to easily
// pass in either a "const char*" or a "string".
//
// Arghh!  I wish C++ literals were automatically of type "string".

#ifndef _PCRE_STRINGPIECE_H
#define _PCRE_STRINGPIECE_H

#include <cstring>
#include <string>
#include <iosfwd>    // for ostream forward-declaration

#if 0
#define HAVE_TYPE_TRAITS
#include <type_traits.h>
#elif 0
#define HAVE_TYPE_TRAITS
#include <bits/type_traits.h>
#endif

#include <pcre.h>

namespace pcrecpp {

using std::memcmp;
using std::strlen;
using std::string;

class PCRECPP_EXP_DEFN StringPiece {
 private:
  const char*   ptr_;
  int           length_;

 public:
  // We provide non-explicit singleton constructors so users can pass
  // in a "const char*" or a "string" wherever a "StringPiece" is
  // expected.
  StringPiece()
    : ptr_(NULL), length_(0) { }
  StringPiece(const char* str)
    : ptr_(str), length_(static_cast<int>(strlen(ptr_))) { }
  StringPiece(const unsigned char* str)
    : ptr_(reinterpret_cast<const char*>(str)),
      length_(static_cast<int>(strlen(ptr_))) { }
  StringPiece(const string& str)
    : ptr_(str.data()), length_(static_cast<int>(str.size())) { }
  StringPiece(const char* offset, int len)
    : ptr_(offset), length_(len) { }

  // data() may return a pointer to a buffer with embedded NULs, and the
  // returned buffer may or may not be null terminated.  Therefore it is
  // typically a mistake to pass data() to a routine that expects a NUL
  // terminated string.  Use "as_string().c_str()" if you really need to do
  // this.  Or better yet, change your routine so it does not rely on NUL
  // termination.
  const char* data() const { return ptr_; }
  int size() const { return length_; }
  bool empty() const { return length_ == 0; }

  void clear() { ptr_ = NULL; length_ = 0; }
  void set(const char* buffer, int len) { ptr_ = buffer; length_ = len; }
  void set(const char* str) {
    ptr_ = str;
    length_ = static_cast<int>(strlen(str));
  }
  void set(const void* buffer, int len) {
    ptr_ = reinterpret_cast<const char*>(buffer);
    length_ = len;
  }

  char operator[](int i) const { return ptr_[i]; }

  void remove_prefix(int n) {
    ptr_ += n;
    length_ -= n;
  }

  void remove_suffix(int n) {
    length_ -= n;
  }

  bool operator==(const StringPiece& x) const {
    return ((length_ == x.length_) &&
            (memcmp(ptr_, x.ptr_, length_) == 0));
  }
  bool operator!=(const StringPiece& x) const {
    return !(*this == x);
  }

#define STRINGPIECE_BINARY_PREDICATE(cmp,auxcmp)                             \
  bool operator cmp (const StringPiece& x) const {                           \
    int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_); \
    return ((r auxcmp 0) || ((r == 0) && (length_ cmp x.length_)));          \
  }
  STRINGPIECE_BINARY_PREDICATE(<,  <);
  STRINGPIECE_BINARY_PREDICATE(<=, <);
  STRINGPIECE_BINARY_PREDICATE(>=, >);
  STRINGPIECE_BINARY_PREDICATE(>,  >);
#undef STRINGPIECE_BINARY_PREDICATE

  int compare(const StringPiece& x) const {
    int r = memcmp(ptr_, x.ptr_, length_ < x.length_ ? length_ : x.length_);
    if (r == 0) {
      if (length_ < x.length_) r = -1;
      else if (length_ > x.length_) r = +1;
    }
    return r;
  }

  string as_string() const {
    return string(data(), size());
  }

  void CopyToString(string* target) const {
    target->assign(ptr_, length_);
  }

  // Does "this" start with "x"
  bool starts_with(const StringPiece& x) const {
    return ((length_ >= x.length_) && (memcmp(ptr_, x.ptr_, x.length_) == 0));
  }
};

}   // namespace pcrecpp

// ------------------------------------------------------------------
// Functions used to create STL containers that use StringPiece
//  Remember that a StringPiece's lifetime had better be less than
//  that of the underlying string or char*.  If it is not, then you
//  cannot safely store a StringPiece into an STL container
// ------------------------------------------------------------------

#ifdef HAVE_TYPE_TRAITS
// This makes vector<StringPiece> really fast for some STL implementations
template<> struct __type_traits<pcrecpp::StringPiece> {
  typedef __true_type    has_trivial_default_constructor;
  typedef __true_type    has_trivial_copy_constructor;
  typedef __true_type    has_trivial_assignment_operator;
  typedef __true_type    has_trivial_destructor;
  typedef __true_type    is_POD_type;
};
#endif

// allow StringPiece to be logged
PCRECPP_EXP_DECL std::ostream& operator<<(std::ostream& o,
                                          const pcrecpp::StringPiece& piece);

#endif /* _PCRE_STRINGPIECE_H */
Name
Size
Permissions
Options
GL
--
drwxr-xr-x
X11
--
drwxr-xr-x
apache2
--
drwxr-xr-x
arpa
--
drwxr-xr-x
asm
--
drwxr-xr-x
asm-generic
--
drwxr-xr-x
bind9
--
drwxr-xr-x
bits
--
drwxr-xr-x
bsock
--
drwxr-xr-x
c++
--
drwxr-xr-x
criu
--
drwxr-xr-x
curl
--
drwxr-xr-x
drm
--
drwxr-xr-x
e2p
--
drwxr-xr-x
et
--
drwxr-xr-x
event2
--
drwxr-xr-x
ext2fs
--
drwxr-xr-x
finclude
--
drwxr-xr-x
fontconfig
--
drwxr-xr-x
freetype2
--
drwxr-xr-x
fstrm
--
drwxr-xr-x
gdb
--
drwxr-xr-x
gdbm
--
drwxr-xr-x
gnu
--
drwxr-xr-x
google
--
drwxr-xr-x
gssapi
--
drwxr-xr-x
gssrpc
--
drwxr-xr-x
jemalloc
--
drwxr-xr-x
json-c
--
drwxr-xr-x
kadm5
--
drwxr-xr-x
krb5
--
drwxr-xr-x
libdb
--
drwxr-xr-x
libexslt
--
drwxr-xr-x
libltdl
--
drwxr-xr-x
libpng16
--
drwxr-xr-x
libxml2
--
drwxr-xr-x
libxslt
--
drwxr-xr-x
linux
--
drwxr-xr-x
lua-5.1
--
drwxr-xr-x
lzma
--
drwxr-xr-x
misc
--
drwxr-xr-x
mtd
--
drwxr-xr-x
mysql
--
drwxr-xr-x
ncurses
--
drwxr-xr-x
ncursesw
--
drwxr-xr-x
net
--
drwxr-xr-x
netash
--
drwxr-xr-x
netatalk
--
drwxr-xr-x
netax25
--
drwxr-xr-x
neteconet
--
drwxr-xr-x
netinet
--
drwxr-xr-x
netipx
--
drwxr-xr-x
netiucv
--
drwxr-xr-x
netpacket
--
drwxr-xr-x
netrom
--
drwxr-xr-x
netrose
--
drwxr-xr-x
nfs
--
drwxr-xr-x
openssl
--
drwxr-xr-x
perf
--
drwxr-xr-x
protobuf-c
--
drwxr-xr-x
protocols
--
drwxr-xr-x
python2.7
--
drwxr-xr-x
python3.6m
--
drwxr-xr-x
python3.8
--
drwxr-xr-x
rdma
--
drwxr-xr-x
rpc
--
drwxr-xr-x
sasl
--
drwxr-xr-x
scsi
--
drwxr-xr-x
security
--
drwxr-xr-x
selinux
--
drwxr-xr-x
sepol
--
drwxr-xr-x
sound
--
drwxr-xr-x
sys
--
drwxr-xr-x
uuid
--
drwxr-xr-x
video
--
drwxr-xr-x
webp
--
drwxr-xr-x
xcb
--
drwxr-xr-x
xen
--
drwxr-xr-x
FlexLexer.h
6.731 KB
-rw-r--r--
a.out.h
4.248 KB
-rw-r--r--
aio.h
7.281 KB
-rw-r--r--
aliases.h
1.983 KB
-rw-r--r--
alloca.h
1.175 KB
-rw-r--r--
ar.h
1.689 KB
-rw-r--r--
argp.h
24.818 KB
-rw-r--r--
argz.h
5.908 KB
-rw-r--r--
assert.h
4.454 KB
-rw-r--r--
autosprintf.h
2.327 KB
-rw-r--r--
byteswap.h
1.371 KB
-rw-r--r--
bzlib.h
6.099 KB
-rw-r--r--
com_err.h
2.068 KB
-rw-r--r--
complex.h
6.995 KB
-rw-r--r--
cpio.h
2.214 KB
-rw-r--r--
cpuidle.h
0.824 KB
-rw-r--r--
crypt.h
8.904 KB
-rw-r--r--
ctype.h
10.706 KB
-rw-r--r--
curses.h
97.29 KB
-rw-r--r--
cursesapp.h
6.616 KB
-rw-r--r--
cursesf.h
27.196 KB
-rw-r--r--
cursesm.h
19.216 KB
-rw-r--r--
cursesp.h
8.399 KB
-rw-r--r--
cursesw.h
48.554 KB
-rw-r--r--
cursslk.h
7.133 KB
-rw-r--r--
db.h
120.22 KB
-r--r--r--
db_185.h
5.843 KB
-r--r--r--
dbm.h
1.381 KB
-rw-r--r--
dirent.h
12.191 KB
-rw-r--r--
dlfcn.h
7.068 KB
-rw-r--r--
elf.h
170.73 KB
-rw-r--r--
endian.h
3.114 KB
-rw-r--r--
entities.h
4.814 KB
-rw-r--r--
envz.h
2.799 KB
-rw-r--r--
err.h
2.157 KB
-rw-r--r--
errno.h
1.639 KB
-rw-r--r--
error.h
1.991 KB
-rw-r--r--
eti.h
2.823 KB
-rw-r--r--
etip.h
9.475 KB
-rw-r--r--
evdns.h
1.972 KB
-rw-r--r--
event.h
2.68 KB
-rw-r--r--
evhttp.h
1.987 KB
-rw-r--r--
evrpc.h
1.968 KB
-rw-r--r--
evutil.h
1.74 KB
-rw-r--r--
execinfo.h
1.486 KB
-rw-r--r--
expat.h
43.235 KB
-rw-r--r--
expat_config.h
3.818 KB
-rw-r--r--
expat_external.h
5.888 KB
-rw-r--r--
fcntl.h
10.701 KB
-rw-r--r--
features.h
15.686 KB
-rw-r--r--
fenv.h
5.72 KB
-rw-r--r--
fmtmsg.h
3.163 KB
-rw-r--r--
fnmatch.h
2.241 KB
-rw-r--r--
form.h
18.165 KB
-rw-r--r--
fpu_control.h
3.499 KB
-rw-r--r--
fstab.h
3.038 KB
-rw-r--r--
fstrm.h
12.712 KB
-rw-r--r--
fts.h
8.176 KB
-rw-r--r--
ftw.h
5.128 KB
-rw-r--r--
gconv.h
4.307 KB
-rw-r--r--
gcrypt.h
68.712 KB
-rw-r--r--
gd.h
56.423 KB
-rw-r--r--
gd_color_map.h
0.467 KB
-rw-r--r--
gd_errors.h
1.468 KB
-rw-r--r--
gd_io.h
3.052 KB
-rw-r--r--
gdbm.h
10.103 KB
-rw-r--r--
gdcache.h
2.83 KB
-rw-r--r--
gdfontg.h
0.54 KB
-rw-r--r--
gdfontl.h
0.538 KB
-rw-r--r--
gdfontmb.h
0.507 KB
-rw-r--r--
gdfonts.h
0.503 KB
-rw-r--r--
gdfontt.h
0.533 KB
-rw-r--r--
gdfx.h
0.485 KB
-rw-r--r--
gdpp.h
50.939 KB
-rw-r--r--
getopt.h
1.434 KB
-rw-r--r--
gettext-po.h
15.17 KB
-rw-r--r--
glob.h
6.459 KB
-rw-r--r--
gnu-versions.h
2.287 KB
-rw-r--r--
gnumake.h
2.844 KB
-rw-r--r--
gpg-error.h
66.288 KB
-rw-r--r--
gpgrt.h
66.288 KB
-rw-r--r--
grp.h
6.529 KB
-rw-r--r--
gshadow.h
4.422 KB
-rw-r--r--
gssapi.h
0.177 KB
-rw-r--r--
iconv.h
1.813 KB
-rw-r--r--
idn-free.h
2.414 KB
-rw-r--r--
idn-int.h
0.02 KB
-rw-r--r--
idna.h
3.48 KB
-rw-r--r--
ieee754.h
4.795 KB
-rw-r--r--
ifaddrs.h
2.773 KB
-rw-r--r--
inttypes.h
11.613 KB
-rw-r--r--
jconfig-64.h
2.173 KB
-rw-r--r--
jconfig.h
0.24 KB
-rw-r--r--
jerror.h
14.734 KB
-rw-r--r--
jmorecfg.h
14.696 KB
-rw-r--r--
jpegint.h
15.221 KB
-rw-r--r--
jpeglib.h
48.706 KB
-rw-r--r--
kdb.h
67.661 KB
-rw-r--r--
keyutils.h
7.518 KB
-rw-r--r--
krad.h
8.724 KB
-rw-r--r--
krb5.h
0.393 KB
-rw-r--r--
langinfo.h
17.43 KB
-rw-r--r--
lastlog.h
0.123 KB
-rw-r--r--
lber.h
14.952 KB
-rw-r--r--
lber_types.h
1.434 KB
-rw-r--r--
ldap.h
63.57 KB
-rw-r--r--
ldap_cdefs.h
9.244 KB
-rw-r--r--
ldap_features.h
1.771 KB
-rw-r--r--
ldap_schema.h
9.229 KB
-rw-r--r--
ldap_utf8.h
3.387 KB
-rw-r--r--
ldif.h
4.582 KB
-rw-r--r--
libaio.h
8.728 KB
-rw-r--r--
libgen.h
1.353 KB
-rw-r--r--
libintl.h
4.472 KB
-rw-r--r--
limits.h
5.285 KB
-rw-r--r--
link.h
7.049 KB
-rw-r--r--
locale.h
7.494 KB
-rw-r--r--
ltdl.h
5.575 KB
-rw-r--r--
lzma.h
9.587 KB
-rw-r--r--
magic.h
5.457 KB
-rw-r--r--
malloc.h
5.959 KB
-rw-r--r--
math.h
52.068 KB
-rw-r--r--
mcheck.h
2.377 KB
-rw-r--r--
memory.h
0.933 KB
-rw-r--r--
menu.h
11.911 KB
-rw-r--r--
mntent.h
3.279 KB
-rw-r--r--
monetary.h
1.761 KB
-rw-r--r--
mqueue.h
3.671 KB
-rw-r--r--
nc_tparm.h
4.099 KB
-rw-r--r--
ncurses.h
97.29 KB
-rw-r--r--
ncurses_dll.h
4.177 KB
-rw-r--r--
ndbm.h
2.396 KB
-rw-r--r--
netdb.h
27.44 KB
-rw-r--r--
nl_types.h
1.711 KB
-rw-r--r--
nss.h
1.834 KB
-rw-r--r--
obstack.h
20.807 KB
-rw-r--r--
panel.h
4.026 KB
-rw-r--r--
paths.h
2.907 KB
-rw-r--r--
pcre.h
30.975 KB
-rw-r--r--
pcre2.h
43.752 KB
-rw-r--r--
pcre2posix.h
5.668 KB
-rw-r--r--
pcre_scanner.h
6.445 KB
-rw-r--r--
pcre_stringpiece.h
6.164 KB
-rw-r--r--
pcrecpp.h
25.907 KB
-rw-r--r--
pcrecpparg.h
6.624 KB
-rw-r--r--
pcreposix.h
5.324 KB
-rw-r--r--
png.h
140.771 KB
-rw-r--r--
pngconf.h
22.31 KB
-rw-r--r--
pnglibconf.h
7.39 KB
-rw-r--r--
poll.h
0.021 KB
-rw-r--r--
pr29.h
2.073 KB
-rw-r--r--
printf.h
6.641 KB
-rw-r--r--
proc_service.h
3.395 KB
-rw-r--r--
profile.h
11.869 KB
-rw-r--r--
pthread.h
40.302 KB
-rw-r--r--
pty.h
1.532 KB
-rw-r--r--
punycode.h
9.164 KB
-rw-r--r--
pwd.h
6.014 KB
-rw-r--r--
re_comp.h
0.939 KB
-rw-r--r--
regex.h
24.136 KB
-rw-r--r--
regexp.h
1.413 KB
-rw-r--r--
resolv.h
11.868 KB
-rw-r--r--
sched.h
4.621 KB
-rw-r--r--
search.h
5.101 KB
-rw-r--r--
semaphore.h
2.343 KB
-rw-r--r--
setjmp.h
3.583 KB
-rw-r--r--
sgtty.h
1.312 KB
-rw-r--r--
shadow.h
5.343 KB
-rw-r--r--
signal.h
11.956 KB
-rw-r--r--
slapi-plugin.h
37.452 KB
-rw-r--r--
spawn.h
6.533 KB
-rw-r--r--
stab.h
0.258 KB
-rw-r--r--
stdc-predef.h
2.235 KB
-rw-r--r--
stdint.h
8.271 KB
-rw-r--r--
stdio.h
29.461 KB
-rw-r--r--
stdio_ext.h
2.733 KB
-rw-r--r--
stdlib.h
34.817 KB
-rw-r--r--
string.h
17.175 KB
-rw-r--r--
stringprep.h
8.034 KB
-rw-r--r--
strings.h
4.641 KB
-rw-r--r--
syscall.h
0.024 KB
-rw-r--r--
sysexits.h
5.109 KB
-rw-r--r--
syslog.h
0.023 KB
-rw-r--r--
tar.h
3.696 KB
-rw-r--r--
term.h
40.225 KB
-rw-r--r--
term_entry.h
8.555 KB
-rw-r--r--
termcap.h
3.392 KB
-rw-r--r--
termio.h
0.209 KB
-rw-r--r--
termios.h
3.514 KB
-rw-r--r--
tgmath.h
30.751 KB
-rw-r--r--
thread_db.h
15.647 KB
-rw-r--r--
threads.h
6.499 KB
-rw-r--r--
tic.h
13.318 KB
-rw-r--r--
tiff.h
35.14 KB
-rw-r--r--
tiffconf-64.h
3.349 KB
-rw-r--r--
tiffconf.h
0.244 KB
-rw-r--r--
tiffio.h
22.683 KB
-rw-r--r--
tiffio.hxx
1.662 KB
-rw-r--r--
tiffvers.h
0.4 KB
-rw-r--r--
time.h
10.117 KB
-rw-r--r--
tld.h
4.541 KB
-rw-r--r--
ttyent.h
2.436 KB
-rw-r--r--
uchar.h
1.954 KB
-rw-r--r--
ucontext.h
1.988 KB
-rw-r--r--
ulimit.h
1.546 KB
-rw-r--r--
unctrl.h
3.026 KB
-rw-r--r--
unistd.h
41.736 KB
-rw-r--r--
utime.h
1.466 KB
-rw-r--r--
utmp.h
3.146 KB
-rw-r--r--
utmpx.h
4.003 KB
-rw-r--r--
values.h
1.909 KB
-rw-r--r--
verto-module.h
6.484 KB
-rw-r--r--
verto.h
18.981 KB
-rw-r--r--
wait.h
0.021 KB
-rw-r--r--
wchar.h
30.382 KB
-rw-r--r--
wctype.h
5.418 KB
-rw-r--r--
wordexp.h
2.442 KB
-rw-r--r--
zconf.h
15.881 KB
-rw-r--r--
zlib.h
94.005 KB
-rw-r--r--