开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
devel
分支 (25)
devel
spiderbasic-3.10
v6.21
v6.20
spiderbasic-3.02
qt
v6.12
spiderbasic-3.01
enablejs-ignore-formatting
master
spiderbasic-3.00
webview-tool
v6.11
v6.10
v6.04
spiderbasic-2.51
v6.03
editor-fix-3
editor-slow-fix2
editor-slow-fix
purebasic
/
PureBasicIDE
/
FileSystem.pb
purebasic
/
PureBasicIDE
/
FileSystem.pb
FileSystem.pb 8.50 KB
一键复制 编辑 原始数据 按行查看 历史
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
; --------------------------------------------------------------------------------------------
; Copyright (c) Fantaisie Software. All rights reserved.
; Dual licensed under the GPL and Fantaisie Software licenses.
; See LICENSE and LICENSE-FANTAISIE in the project root for license information.
; --------------------------------------------------------------------------------------------
; --------------------------------------------------------------
;
; Functions for easier working with filenames on all platforms.
;
; Note: This file is standalone and does not need anything from
; the IDE sources, so it can be used in any other project as well.
;
; This file is unicode ready.
;
; Used by: IDE, Debugger, PureUnit
;
; --------------------------------------------------------------
; redefine these from the IDE source if not present
;
CompilerIf Defined(Separator, #PB_Constant) = 0
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
#Separator = "\"
CompilerElse
#Separator = "/"
CompilerEndIf
CompilerEndIf
; Creates a unique representation of a filename, by doing this:
; - replaces any "../directory" parts to get a direct path
; - removes multiple redundant "//" in the path
; - cutting any "./" in the path
; - on Windows, replaces all "/" by "\" as both are allowed.
;
; The resulting path can be compared for equalness by only taking
; care or the case sensitivity of the filesystem.
;
; Returns "" if the path contains more "../" than directories!
;
Procedure.s UniqueFilename(FileName$)
; Got a 0-pointer here on Linux once.
If FileName$ = ""
ProcedureReturn ""
EndIf
; On Windows, we need to replace all "/" with "\" to have a unique path,
; as both can be mixed as separator characters!
;
; We also do the conversion in the other direction so we can easily share
; Project files and compiler settings between Windows and Linux.
;
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
FileName$ = ReplaceString(FileName,ドル "/", "\")
CompilerElse
FileName$ = ReplaceString(FileName,ドル "\", "/")
CompilerEndIf
*Cursor.Character = @FileName$
While *Cursor\c
If *Cursor\c = Asc(#Separator)
If PeekS(*Cursor, 4) = #Separator + ".." + #Separator
; remove the previous directory name
*BackCursor.Character = *Cursor - SizeOf(Character)
While *BackCursor >= @FileName$
If *BackCursor\c = Asc(#Separator)
Break
EndIf
*BackCursor - SizeOf(Character)
Wend
If *BackCursor < @FileName$
; oops, more ".." in the string than directories!
ProcedureReturn ""
EndIf
; poking in the string is ok, since it can only get shorter by this
PokeS(*BackCursor, PeekS(*Cursor + 3*SizeOf(Character)))
; Make sure the cursor stays inside the string.
; Otherwise, if removing a large dir towards the string end, *Cursor might
; end up outside of the valid string and create an endless loop
*Cursor = *BackCursor
ElseIf PeekS(*Cursor, 3) = #Separator + "." + #Separator
; simply remove this reference to the own directory
PokeS(*Cursor, PeekS(*Cursor + 2*SizeOf(Character)))
ElseIf PeekS(*Cursor, 2) = #Separator + #Separator
; Redundant "\\" or "//". Remove one of them
; Special case: On Windows a path starting with \\ is a UNC network oath
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
If *Cursor = @FileName$
*Cursor + (SizeOf(Character) * 2)
Continue
EndIf
CompilerEndIf
PokeS(*Cursor, PeekS(*Cursor + SizeOf(Character)))
; Do not skip the remaining "/" yet to reprocess it in the next loop so do not increase *Cursor here
Else
*Cursor + SizeOf(Character)
EndIf
Else
*Cursor + SizeOf(Character)
EndIf
Wend
ProcedureReturn Filename$
EndProcedure
; Returns true if the two (full) filenames are representing
; the same file. This function calls UniqueFilename().
;
Procedure IsEqualFile(File1,ドル File2$)
File1$ = UniqueFilename(File1$)
File2$ = UniqueFilename(File2$)
; The UniqueFilename() returns "" if the filename has too many "../"
;
If File1$ <> "" And File2$ <> ""
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
If File1$ = File2$
ProcedureReturn #True
EndIf
CompilerElse
If UCase(File1$) = UCase(File2$)
ProcedureReturn #True
EndIf
CompilerEndIf
EndIf
ProcedureReturn #False
EndProcedure
; Creates a relative path representation of the (full) FileName$
; relative to the (full) BasePath$. Note that the full FileName$ is returned
; if no relative path can be created (different drives), or if there
; would be too many "../../" involved.
;
Procedure.s CreateRelativePath(BasePath,ドル FileName$)
If FileName$ = "" ; otherwise this gives an ugly "../../"
ProcedureReturn ""
EndIf
; make sure both have no "../" or "/", "\" mixups
FileName$ = UniqueFilename(FileName$)
BasePath$ = UniqueFilename(BasePath$)
; check if both are really full paths:
;
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
If Mid(BasePath,ドル 2, 1) = ":" And Mid(FileName,ドル 2, 1) = ":"
; Both have drive letters.. check the drive match
If UCase(Left(BasePath,ドル 1)) <> UCase(Left(FileName,ドル 1))
ProcedureReturn FileName$
EndIf
ElseIf Left(BasePath,ドル 2) = "\\" And Left(FileName,ドル 2) = "\\"
; Both are network paths, check if the computer name matches
If UCase(StringField(BasePath,ドル 3, "\")) <> UCase(StringField(FileName,ドル 3, "\"))
ProcedureReturn FileName$
EndIf
Else
; Either a mix of Network/non-network paths, or not full paths at all
ProcedureReturn FileName$
EndIf
CompilerElse
If Left(BasePath,ドル 1) <> "/" Or Left(FileName,ドル 1) <> "/"
ProcedureReturn FileName$
EndIf
CompilerEndIf
If Right(BasePath,ドル 1) <> #Separator
BasePath$ + #Separator
EndIf
FullFileName$ = FileName$ ; make backup for later
; process the part that is identical
;
For x = Len(BasePath$) To 1 Step -1
If Mid(BasePath,ドル x, 1) = #Separator
Protected CaseMode
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
CaseMode = #PB_String_CaseSensitive
CompilerElse
CaseMode = #PB_String_NoCase
CompilerEndIf
If CompareMemoryString(@BasePath,ドル @FileName,ドル CaseMode, x) = 0
BasePath$ = Right(BasePath,ドル Len(BasePath$)-x)
FileName$ = Right(FileName,ドル Len(FileName$)-x)
Break
EndIf
EndIf
Next x
; now add ".." for each directory left in the BasePath$
;
count = CountString(BasePath,ドル #Separator)
If count <= 3 ; do not go too many levels back.. it looks ugly
For i = 1 To count
FileName$ = ".." + #Separator + FileName$
Next i
Else
FileName$ = FullFileName$ ; use the full name here
EndIf
ProcedureReturn FileName$
EndProcedure
; Tries to resolve a (relative or full) FileName$ relative to the
; (full) BasePath$. The returned filename is made unique with
; UniqueFilename()
;
Procedure.s ResolveRelativePath(BasePath,ドル FileName$)
; do the cutting of "../" even if basepath is actually empty
If BasePath$ <> ""
BasePath$ = UniqueFilename(BasePath$)
If Right(BasePath,ドル 1) <> #Separator
BasePath$ + #Separator
EndIf
If FindString(FileName,ドル #Separator, 1) = 0
FileName$ = BasePath$ + FileName$
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
ElseIf Left(FileName,ドル 2) = "\\" ; Network file path, Windows only (like: \192円.168.0.1\Test.pb)
; FileName$ remains untouched here (it contains a drive letter)
CompilerEndIf
ElseIf Left(FileName,ドル 1) = #Separator
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
FileName$ = Left(BasePath,ドル 2) + FileName$
CompilerEndIf
; On linux/mac. FileName is a full path, so no change
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
ElseIf Mid(FileName,ドル 2, 1) = ":"
; FileName$ remains untouched here (it contains a drive letter)
CompilerEndIf
Else
FileName$ = BasePath$ + FileName$
EndIf
EndIf
; the UniqueFilename() cuts all the "../" in the combined path
; Do this even if FileName$ was a full path to get a unique name as
; the debugger reports full filenames containing "../" for example.
;
ProcedureReturn UniqueFilename(FileName$)
EndProcedure
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

PureBasic是由Fantaisie Software所开发的商用BASIC程序语言及集成开发环境。特点是语法简单直接,不依赖运行时库,因此能编译出相当小巧的程序,包含命令列或GUI执行档、DLL等。而且不使用各系统的API,所以有高度的跨平台特性,支持Windows 32/64位元、Linux 32/64位元、Mac OS X、Amiga。
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/PureBasic/purebasic.git
git@gitee.com:PureBasic/purebasic.git
PureBasic
purebasic
PureBASIC
devel
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /