Skip to content

Commit

Permalink
Buffer write support; rudimentary buffer API.
Browse files Browse the repository at this point in the history
  • Loading branch information
secretiverhyme committed Sep 24, 2011
1 parent 486a666 commit bdc7a06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 0 additions & 6 deletions foobar.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
Supercalifragilisticexpialidocious!






8 changes: 6 additions & 2 deletions lib/buffer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ Buffer method initialize {path} {
}

Buffer method getBuffer {} {
return [ref buffer "Buffer value"]
return $buffer
}

Buffer method setBuffer {newBuffer} {
set buffer $newBuffer
}

Buffer method write {} {
# NB: This will clobber anything that tries to get in its way.
set handle [open $filename w\+]
puts $handle $buffer
puts -nonewline $handle $buffer
close $handle
}
4 changes: 0 additions & 4 deletions lib/ix.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ proc ix.run {} {
set fooBuffer [Buffer new]
$fooBuffer initialize "foobar.txt"

set [$fooBuffer getBuffer] "Supercalifragilisticexpialidocious!"

$fooBuffer write

ncurses.do {
stdscr puts [$fooBuffer get buffer]
ncurses.getc
Expand Down

0 comments on commit bdc7a06

Please sign in to comment.