forked from engor/Jentos.Code
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstd.h
executable file
·61 lines (42 loc) · 1.24 KB
/
std.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Ted, a simple text editor/IDE.
Copyright 2012, Blitz Research Ltd.
See LICENSE.TXT for licensing terms.
*/
#ifndef STD_H
#define STD_H
#include <QtGui/QtGui>
#if QT_VERSION>=0x50000
#include <QtWidgets/QtWidgets>
#include <QtWebKitWidgets/QtWebKitWidgets>
#else
#include <QtWebKit/QWebView>
#endif
static QString textFileTypes=";txt;monkeydoc;";
static QString codeFileTypes=";monkey;bmx;cpp;java;js;as;cs;py;";
inline bool isDigit( QChar ch ){
return (ch>='0' && ch<='9');
}
inline bool isBinDigit( QChar ch ){
return ch=='0' || ch=='1';
}
inline bool isOctDigit( QChar ch ){
return (ch>='0' && ch<='7');
}
inline bool isHexDigit( QChar ch ){
return (ch>='0' && ch<='9') || (ch>='A' && ch<='F') || (ch>='a' && ch<='f');
}
inline bool isAlpha( QChar ch ){
return (ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || ch=='_';
}
inline bool isIdent( QChar ch ){
return isAlpha(ch) || isDigit(ch);
}
QString fixPath( QString path );
QString stripDir( const QString &path );
QString extractDir( const QString &path );
QString extractExt( const QString &path );
bool removeDir( const QString &path );
void replaceTabWidgetWidget( QTabWidget *tabWidget,int index,QWidget *widget );
bool isUrl( const QString &path );
#endif // STD_H