I am wondering if you were to write the following Codeigniter PHP code:
$this->load->library('form_validation');
In C++
would it be something like this
class CI {}; //class
CI this; //instance of class made called this
this.load.library('form_validation');
This is purely academic and not for practical purposes.
As I am trying to make an equivelant to CI in C++ for fun
Thanks
There is just so much wrong with this question.
C++ is a compiled language vs PHP which is interpreted.
In C++ one has to include references to libraries using the
#includestatement. This effectively implants the source of that file into the file being used.The codeigniter example is loading its own library code since its a framework.
This could be accomplished in C++ by writing one’s own framework and libraries.
Codeigniter is basically parsing the library at runtime to add functionality.
The same could be done by writing a server wrapper with functionality to import C++ code when passed a library argument.