Skip to content

Instantly share code, notes, and snippets.

@leontastic
Last active August 29, 2015 14:07
Show Gist options
  • Save leontastic/ed966e33cb9aeb1916c0 to your computer and use it in GitHub Desktop.
Save leontastic/ed966e33cb9aeb1916c0 to your computer and use it in GitHub Desktop.
Improved documentation for the commands to be used in the test harness for A3Q2 (CS 246)
### STRING CONCATENATION
s destination source1 source2 // + - [[ MUTATE ]] concatenate two sources
t destination source1 string // + - [[ MUTATE ]] concatenate a source followed by a specified string
### FIND
/ source1 source2 // / - [[ PRINT ]] print number of times source2 appears in source1
% destination source1 source2 // % - [[ MUTATE ]] removes occurrences of source2 in source1
### MEMORY MANAGEMENT
f destination // default constructor - [[ CREATE ]] create empty iString (basically, empty string)
n destination string // iString(char*) - [[ CREATE ]] create an iString object with given string as contents
i destination source // copy constructor - [[ COPY ]] copy an existing iString object using the copy constructor
= destination source // = - [[ COPY ]] copy an existing iString object using the assignment operator
e source // delete source/call destructor - [[ DESTROY ]] cleans up memory (must be called whenever new iStrings are created)
### AUXILIARY
r destination string // >> - [[ READ ]] read a string into an iString object
w source // - [[ PRINT ]] print the iString
l source // - [[ PRINT ]] print length of iString
@m45yang
Copy link

m45yang commented Oct 17, 2014

For '=' maybe you could label it [[ ASSIGNMENT ]] instead of [[ COPY ]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment