Quote the \ in doc comments.
This commit is contained in:
parent
63c4f204e8
commit
ad67bfcf46
1 changed files with 5 additions and 5 deletions
|
|
@ -263,8 +263,8 @@ proc toString*(ms: MemSlice): string {.inline.} =
|
||||||
|
|
||||||
iterator memSlices*(mfile: MemFile, delim='\l', eat='\r'): MemSlice {.inline.} =
|
iterator memSlices*(mfile: MemFile, delim='\l', eat='\r'): MemSlice {.inline.} =
|
||||||
## Iterates over [optional eat]delim-delimited slices in a MemFile.
|
## Iterates over [optional eat]delim-delimited slices in a MemFile.
|
||||||
## Default delimiting is [\r]\l which parse Unix or Windows text file lines.
|
## Default delimiting is [\\r]\\l which parse Unix or Windows text file lines.
|
||||||
## Pass eat='\0' to be strictly delim-delimited.
|
## Pass eat='\\0' to be strictly delim-delimited.
|
||||||
## This zero copy, memchr-limited method is probably the fastest way to
|
## This zero copy, memchr-limited method is probably the fastest way to
|
||||||
## iterate through lines in a file, however the returned (data,size) objects
|
## iterate through lines in a file, however the returned (data,size) objects
|
||||||
## are NOT Nim strings or even terminated C strings. So, be careful how data
|
## are NOT Nim strings or even terminated C strings. So, be careful how data
|
||||||
|
|
@ -291,8 +291,8 @@ iterator memSlices*(mfile: MemFile, delim='\l', eat='\r'): MemSlice {.inline.} =
|
||||||
|
|
||||||
iterator lines*(mfile: MemFile, buf: var TaintedString, delim='\l', eat='\r'): TaintedString {.inline.} =
|
iterator lines*(mfile: MemFile, buf: var TaintedString, delim='\l', eat='\r'): TaintedString {.inline.} =
|
||||||
## Replace contents of passed buffer with each new line, like readLine(File).
|
## Replace contents of passed buffer with each new line, like readLine(File).
|
||||||
## Default delimiting is [\r]\l which parse Unix or Windows text file lines.
|
## Default delimiting is [\\r]\\l which parse Unix or Windows text file lines.
|
||||||
## Pass eat='\0' to be strictly delim-delimited.
|
## Pass eat='\\0' to be strictly delim-delimited.
|
||||||
for ms in memSlices(mfile, delim, eat):
|
for ms in memSlices(mfile, delim, eat):
|
||||||
buf.setLen(ms.size)
|
buf.setLen(ms.size)
|
||||||
c_memcpy(addr(buf[0]), ms.data, ms.size)
|
c_memcpy(addr(buf[0]), ms.data, ms.size)
|
||||||
|
|
@ -301,7 +301,7 @@ iterator lines*(mfile: MemFile, buf: var TaintedString, delim='\l', eat='\r'): T
|
||||||
|
|
||||||
iterator lines*(mfile: MemFile, delim='\l', eat='\r'): TaintedString {.inline.} =
|
iterator lines*(mfile: MemFile, delim='\l', eat='\r'): TaintedString {.inline.} =
|
||||||
## Return each line in a file as a Nim string, like lines(File).
|
## Return each line in a file as a Nim string, like lines(File).
|
||||||
## Default delimiting is [\r]\l which parse Unix or Windows text file lines.
|
## Default delimiting is [\\r]\\l which parse Unix or Windows text file lines.
|
||||||
## Pass eat='\0' to be strictly delim-delimited.
|
## Pass eat='\0' to be strictly delim-delimited.
|
||||||
var buf = TaintedString(newStringOfCap(80))
|
var buf = TaintedString(newStringOfCap(80))
|
||||||
for line in lines(mfile, buf, delim, eat):
|
for line in lines(mfile, buf, delim, eat):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue