For a const pointer, getContents() and other member functions being called here also need to be declared const.
I didn't mock you at all. I described characteristics of your definition of the operator<<() for your class, highlighting what I consider to be problems.
Admittedly, I didn't describe solutions to those problems, but that isn't personal. It's just a reflection of limited time I had at my disposal when I posted, and that it's often difficult to know where to start with such explanations to a beginner, nothing more. If you follow advice of other posters since, you will have addressed a number of the problems I pointed out.