简体   繁体   中英

Using LD_PRELOAD with fstream

I am using LD_PRELOAD to overload system() , fopen() etc. and now i want to replace fstream with my own implementation but i don't know where to start. I searched the web but can't find any good examples about overloading parts or a whole of a class. Any help would be appreciated.

Thanks.

The search term you'll need is "name mangling". Every method of a class has an internal name which is compatible with the platform conventions. This name is generated by the compiler.

Name mangling is deterministic, so if you implement the same methods they'll have the same mangled names.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM