I am trying to make a C++ class for Nspire I/O that works like the standard iostream class.
For this purpose, I have the class
console, which is just a simple C++ wrapper for Nspire I/O, and the class
nio_base, that provides stuff from the standard
ios_base class.
The class
iostream inherits from both console and nio_base, so we can use the <<, >> operators and more for Nspire I/O consoles.
My problem is, when I am trying to set the field width with the function
width() from nio_base to 10, it stays 0 when I read it from
inside the iostream class.
Also, using
setf() crashes the emulator.
This is the code I'm trying to run.Basically everything works, except the field width change and the unsetf/setf stuff.
The code works fine on the
other branch where the nio_base stuff is integrated into iostream, but I wanted to separate it so I don't have to duplicate the code for RS232 communcication.
Download the codeTo build,
make lib install in the root dir
make lib install demo in niostream
Make sure there are no old versions of Nspire I/O in your Ndless SDK.