-
Notifications
You must be signed in to change notification settings - Fork 0
/
path.h
45 lines (39 loc) · 1.23 KB
/
path.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef _H_PATH
#define _H_PATH
#ifndef _H_PUN_TYPE
#include "puntype.h"
#endif
#ifndef _H_TEXT
#include "text.h"
#endif
/*!
Little class to handle directory paths
which may or may not be wanted to end in the system file path
convention for directory separator.
*/
namespace pun {
class Path : public Php::Base {
protected:
static std::string OSPathSep;
static std::string OtherSep;
public:
static void setup_ext(Php::Extension& ext);
static const char* PHP_NAME;
//! return native system directory separator
static Php::Value sep();
//! String or UStr8 arguments fullstring, test start
static Php::Value startsWith(Php::Parameters& param);
//! String or UStr8 arguments: fullstring, test end
static Php::Value endsWith(Php::Parameters& param);
//! rectify slash direction
static Php::Value native(Php::Parameters& param);
//! ensure system directory separator at end
static Php::Value endSep(Php::Parameters& param);
//! ensure no system directory separator at end
static Php::Value noEndSep(Php::Parameters& param);
protected:
//! return true if a changed value placed in second argument result, else use first argument
static bool fn_native(svx::string_view& src, std::string& result);
};
};
#endif