2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef HPHP_USER_STREAM_WRAPPER_H
17 #define HPHP_USER_STREAM_WRAPPER_H
19 #include "hphp/runtime/base/file.h"
20 #include "hphp/runtime/base/stream-wrapper.h"
21 #include "hphp/runtime/base/user-file.h"
22 #include "hphp/runtime/base/user-directory.h"
25 ///////////////////////////////////////////////////////////////////////////////
27 struct UserStreamWrapper final
: Stream::ExtendedWrapper
{
28 UserStreamWrapper(const String
& name
, Class
*, int flags
);
30 req::ptr
<File
> open(const String
& filename
,
33 const req::ptr
<StreamContext
>& context
) override
;
34 int access(const String
& path
, int mode
) override
;
35 int lstat(const String
& path
, struct stat
* buf
) override
;
36 int stat(const String
& path
, struct stat
* buf
) override
;
37 int unlink(const String
& path
) override
;
38 int rename(const String
& oldname
, const String
& newname
) override
;
39 int mkdir(const String
& path
, int mode
, int options
) override
;
40 int rmdir(const String
& path
, int options
) override
;
41 req::ptr
<Directory
> opendir(const String
& path
) override
;
42 bool touch(const String
& path
, int64_t mtime
, int64_t atime
) override
;
43 bool chmod(const String
& path
, int64_t mode
) override
;
44 bool chown(const String
& path
, int64_t uid
) override
;
45 bool chown(const String
& path
, const String
& uid
) override
;
46 bool chgrp(const String
& path
, int64_t gid
) override
;
47 bool chgrp(const String
& path
, const String
& gid
) override
;
54 ///////////////////////////////////////////////////////////////////////////////
57 #endif // HPHP_USER_STREAM_WRAPPER_H