MCPcopy Create free account
hub / github.com/SFML/SFML / read

Function read

src/SFML/Graphics/Font.cpp:58–70  ·  view source on GitHub ↗

FreeType callbacks that operate on a sf::InputStream

Source from the content-addressed store, hash-verified

56{
57// FreeType callbacks that operate on a sf::InputStream
58unsigned long read(FT_Stream rec, unsigned long offset, unsigned char* buffer, unsigned long count)
59{
60 auto* stream = static_cast<sf::InputStream*>(rec->descriptor.pointer);
61 if (stream->seek(offset) == offset)
62 {
63 if (count > 0)
64 return static_cast<unsigned long>(stream->read(reinterpret_cast<char*>(buffer), count).value());
65
66 return 0;
67 }
68
69 return count > 0 ? 0 : 1; // error code is 0 if we're reading, or nonzero if we're seeking
70}
71void close(FT_Stream)
72{
73}

Callers 5

updateMethod · 0.50
updateMethod · 0.50
eventProcessFunction · 0.50
findExecutableNameFunction · 0.50
updateMethod · 0.50

Calls 2

seekMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected