Home > Mobile > Want to realize the toString method in the c + + each base class, convenient to print each member va
Want to realize the toString method in the c + + each base class, convenient to print each member va
Time:12-06
Want to achieve in the c + + base classes each toString method, convenient log print each member variable values, but his hand writing class member variables too much too much too difficult, I want to a way of thinking is to use the script to automatically generate the toString method, is the class files, use the script to read in, and then identify each class, find a member variable, in the script then write the toString method, write back to the class file, main is to identify classes and member variables, and difficult to deal with custom types, the great god have similar implementation approach or a similar project reference, even the variables Set with the get method to achieve the best
CodePudding user response:
If we can only hope the value you want recorded in the log, don't use the toString method, as long as you use qDebug () will print you want to record to the log data, program boot runtime USES qInstallMessageHandler detailed log (output) can