-----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==(cons t 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)
iQIVAwUBQ5MCn9q td8S+cgRiAQO+ig/+J8BBQRr9x6Wt3u kJLFMsXraunVjzy Xu8
XOLKsRhrHTeYhDV TtcINpDwgl7ilzX 7+LqbQjrQPuLVGJ EtBJmRLayiWiNzn N10y
V5Ulgc9WQqU0JLk PGzyh01wWssLDYC bvzyj5AmW5TlPfI 2DHK5bszd5QNghe GxGP
sWDnbVRuuTnJciz G/mUsDgTBtb6NgWit wiWc0NXtR+z9wNk ohE3S151w0EaJg/K0
LDQvKvPxGX1Jk0m pqME345KvM6mB1q YyrLLVQaUD96TXN rUfjepmL8hNSpTH au72
WzbSSasgEDEuTKo f5cFIHyPrMQrW5G EPyoHTHGlx34F9z nL/02ZClOFiQvi18cc J
6MjQuO6Co2/e4WPMhwmlE142rz +Fz60lpLzfKUanu vyQOthsRqTkqH9Y BgtPS23L
E37jBH571GUvu2g xXNygj4l3/js2SINCu8a3LtMb oU2ecz+zV0Pkum0 J4XiY5tfi
A3rPCwAZiwku33x VnRIJBvQLexiDOQ g2MAcHOHbkbo+Ql vvwZM6LcuWDdGo1 chwS
WgDar36xlyUPiXn/wRJBQsw0IAMabbd y1bfQPw2MvHJanz y7Vt7G4Rf19dbXt OL6
6uUiqUQhrd6a2EE TGSKyjYWFirNiSM jQXnNzmG4nZlmDv gCY93yVIdXvNq5Z C/6h
ljusvZCuZgM=
=Fum7
-----END PGP SIGNATURE-----