Streams

class FSTR::Stream : public IDataSourceStream

Alias: FlashMemoryStream

This is a Sming IDataSourceStream descendant which you can use to stream the contents of any FlashString object. It’s especially useful when used with IMPORT_FSTR:

IMPORT_FSTR(myLargeFile, PROJECT_DIR "/files/lots-of-stuff.txt");
FSTR::Stream fs(myLargeFile);
Serial.println(myLargefile);

Because the data is read in sections, it’s not limited by available RAM.

Note

Unless you need myLargeFile to be a global symbol, you’ll generally want to use IMPORT_FSTR_LOCAL().

Like a FileStream, you can also seek randomly within a FSTR::Stream, so you can use it as the basis for an elementary read-only filesystem.

See Maps for a more useful example.

class FSTR::TemplateStream : public TemplateStream

Alias: TemplateFlashMemoryStream

Standard templating stream for tag replacement.