I present to your attention some interesting classes and functions that I did not find in CopperSpice, but which can be added to it very easily.
1. The QStorage and QStorageDB class
It can serialize C++ classes, which do not need to be modified at all.
To do this, you need to create a Storager helper class. Chris Kawa gave me the idea of an assistant class
on the Qt forum. You can choose the location where the class will be stored - in a file, in memory, or in a database.
For example, we want to restore the APrabhupadaLoginDialog dialog box from a file:
Code: Select all
LoadObject< QStoragerPrabhupadaLoginDialog >( APrabhupadaLoginDialog, &AStorage, QStorageKind::File );
Code: Select all
SaveObject< QStoragerPrabhupadaLoginDialog >( APrabhupadaLoginDialog, &AStorage, QStorageKind::File );
2. We can suggest an interesting simple QEmitValue template for consideration.
Using it, for example, as
using QEmitInt = QEmitValue< int >;
using QEmitBool = QEmitValue< bool >;
and also using inheritance
class Languageindex : public QEmitInt
I have solved almost all the problems in my program "Srila Prabhupada's Dictionary!"
3. StringNumberToWords function - converts a numeric string into a verbal form
, for example "123" -> one hundred and twenty-three. I took the algorithm of this function a long time ago somewhere on the Internet. She was on Pascal. Redone it in C++
4. The Like function, it works as a very simplified regular expression, its operation is similar to the LIKE operator in a SELECT SQL query.
In other words, it compares a string with a string mask that contains two special characters.:
% - means any string, including an empty
one _ - means any letter, but not an empty space.
The Like function is still faster than the regular expressions of QRegularExpression, for example,
Like for the word "mach" successfully found 1298 words in 48 milliseconds
The QRegularExpression for the word "mach" successfully found 1298 words in 94 milliseconds
An example is here.
https://github.com/Navadvipa-Chandra-das/PrabhupadaDictionaryCopperSpice
This project took ideas and inspiration from the Kitchen Sink program.
If you have any problems with the launch, write to me, maybe I can help. The project has not been completed yet.
Thanks!
Sincerely, Navadvipa Chandra das.