-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Hello guys,
I am currently runnging Kubuntu 5.10 on an AMD Athlon XP +1600 machine. I am
trying to implement a file class that allows bitwise access to a file.
I have created a byte class which looks like this:
class byte
{
public:
byte();
byte(const byte& rhs);
virtual ~byte();
void set_bit(const unsigned int p_index, const bool p_value);
bool get_bit(const unsigned int p_index) const;
bool operator==(const byte& rhs) const;
byte& operator=(const byte& rhs);
protected:
bool* m_data;
};
I want to do the following thing:
I want to write a function read() that reads a byte from and write(const
byte&) that writes a byte to an already opened file so that I can access
each bit of it. My problem is that I have absolutely no idea how to do this
as I only know about the std::fread() and std::fwrite() functions that only
allow bytewise access to files. Is there anyone who can help me with that?
Thank you very much.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iQIVAwUBQ5MCn9qtd8S+cgRiAQO+ig/+J8BBQRr9x6Wt3ukJLFMsXraunVjzyXu8
XOLKsRhrHTeYhDVTtcINpDwgl7ilzX7+LqbQjrQPuLVGJEtBJm RLayiWiNznN10y
V5Ulgc9WQqU0JLkPGzyh01wWssLDYCbvzyj5AmW5TlPfI2DHK5 bszd5QNgheGxGP
sWDnbVRuuTnJcizG/mUsDgTBtb6NgWitwiWc0NXtR+z9wNkohE3S151w0EaJg/K0
LDQvKvPxGX1Jk0mpqME345KvM6mB1qYyrLLVQaUD96TXNrUfje pmL8hNSpTHau72
WzbSSasgEDEuTKof5cFIHyPrMQrW5GEPyoHTHGlx34F9znL/02ZClOFiQvi18ccJ
6MjQuO6Co2/e4WPMhwmlE142rz+Fz60lpLzfKUanuvyQOthsRqTkqH9YBgtPS 23L
E37jBH571GUvu2gxXNygj4l3/js2SINCu8a3LtMboU2ecz+zV0Pkum0J4XiY5tfi
A3rPCwAZiwku33xVnRIJBvQLexiDOQg2MAcHOHbkbo+QlvvwZM 6LcuWDdGo1chwS
WgDar36xlyUPiXn/wRJBQsw0IAMabbdy1bfQPw2MvHJanzy7Vt7G4Rf19dbXtOL6
6uUiqUQhrd6a2EETGSKyjYWFirNiSMjQXnNzmG4nZlmDvgCY93 yVIdXvNq5ZC/6h
ljusvZCuZgM=
=Fum7
-----END PGP SIGNATURE-----