Changes

Jump to: navigation, search

OOP344 Assignment One

2 bytes added, 10:56, 1 October 2009
Line Editor: int io_edit(........)
** if '''IsTextEditor''' is false, TAB will simply terminate the function like a Function key
** if '''IsTextEditor''' is true, TAB will insert CIO_TAB_SIZE number of spaces into the string. '''CIO_TAB_SIZE''' should be a defined "tab size" value in ciol.h. (See below for more about '''IsTextEditor''' flag)
'''====IsTextEditor:'''====
If IsTextEditor is true, then it means that the function is being used to edit a text by editing one line of the text at a time. In this case, shifting a line to the left or right should not only cause the editing line to be shifted, but also the rest of the lines in the text. To do this, io_edit should let the calling function take care of shifting instead of doing it by itself. Since shifting essentially means modifying “*offset” when “IsTextEditor” is true, and that there are times when you find that “*offset” needs to be modified, you should terminate the function instead. With termination, the function should return the terminating key. The only exception is when upon the beginning of the execution of io_edit, when validating *offset, make sure to correct the offset before returning the default value of key.

Navigation menu