shell-ahk
Version:
`Lodash`/`jQuery` for `AHK`.
42 lines (32 loc) • 1.11 kB
text/coffeescript
# -check
import $replace from './replace'
import $noop from './noop'
class FileShell
###* import('../type/fileShell').Constructor ###
constructor: (source) ->
###* import('../type/fileShell').FileShell['source'] ###
= source
###* import('../type/fileShell').FileShell['append'] ###
append: (content) ->
$noop content
Native 'FileAppend, % content, % this.source, UTF-8'
return
###* import('../type/fileShell').FileShell['isExists'] ###
isExists: -> FileExist
###* import('../type/fileShell').FileShell['read'] ###
read: ->
unless then return ''
$result = ''
Native 'FileRead, $result, % this.source'
return $replace $result, '\r', ''
###* import('../type/fileShell').FileShell['remove'] ###
remove: ->
unless then return
Native 'FileDelete, % this.source'
return
###* import('../type/fileShell').FileShell['write'] ###
write: (content) ->
content
return
$noop FileShell