public function GenerateClassesHeader($header_name)
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        $header_object = $this->symbols->headers[$header_name];
        $header_define = $this->GetHeaderDefine($header_name);

        $header_content = "";

        if($header_object->HasClasses())
        {
            // Get heading of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "header",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            foreach($header_object->namespaces as $namespace_name=>$namespace_object)
            {
                if($namespace_name == "\\")
                    $namespace_name = "";

                $namespace_name_cpp = str_replace(
                    "\\",
                    "::",
                    $namespace_name
                );

                $namespace_name_var = str_replace(
                    "\\",
                    "_",
                    $namespace_name
                );

                foreach($namespace_object->classes as $class_name=>$class_object)
                {
                    $constructor_code = "";
                    $virtual_methods_code = "";
                    $properties_init_code = "";
                    $properties_uninit_code = "";

                    // Get class declaration code
                    ob_start();
                        include($this->GetTemplatePath(
                            $class_name,
                            "",
                            "declaration",
                            "classes",
                            "declaration"
                        ));
                        $header_content .= ob_get_contents();
                    ob_end_clean();

                    $header_content .= "\n";
                }
            }

            // Get footer of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "footer",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();
        }

        return $header_content;
    }
public function GenerateClassesHeader($header_name)
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        $header_object = $this->symbols->headers[$header_name];
        $header_define = $this->GetHeaderDefine($header_name);

        $header_content = "";

        if($header_object->HasClasses())
        {
            // Get heading of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "header",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            foreach($header_object->namespaces as $namespace_name=>$namespace_object)
            {
                if($namespace_name == "\\")
                    $namespace_name = "";

                $namespace_name_cpp = str_replace(
                    "\\",
                    "::",
                    $namespace_name
                );

                $namespace_name_var = str_replace(
                    "\\",
                    "_",
                    $namespace_name
                );

                foreach($namespace_object->classes as $class_name=>$class_object)
                {
                    $constructor_code = "";
                    $virtual_methods_code = "";
                    $properties_init_code = "";
                    $properties_uninit_code = "";

                    // Get class declaration code
                    ob_start();
                        include($this->GetTemplatePath(
                            $class_name,
                            "",
                            "declaration",
                            "classes",
                            "declaration"
                        ));
                        $header_content .= ob_get_contents();
                    ob_end_clean();

                    $header_content .= "\n";
                }
            }

            // Get footer of header file
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "headers",
                    "footer",
                    "classes",
                    "header"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();
        }

        return $header_content;
    }
public function GenerateClassesHeader ( $ header_name ) { // Variables used by some template files. $ authors = \ Peg \ Lib \ Settings :: GetAuthors ( ) ; $ contributors = \ Peg \ Lib \ Settings :: GetContributors ( ) ; $ extension = \ Peg \ Lib \ Settings :: GetExtensionName ( ) ; $ version = \ Peg \ Lib \ Settings :: GetVersion ( ) ; $ header_object = $ this -> symbols -> headers [ $ header_name ] ; $ header_define = $ this -> GetHeaderDefine ( $ header_name ) ; $ header_content = "" ; if ( $ header_object -> HasClasses ( ) ) { // Get heading of header file ob_start ( ) ; include ( $ this -> GetTemplatePath ( $ header_name , "headers" , "header" , "classes" , "header" ) ) ; $ header_content .= ob_get_contents ( ) ; ob_end_clean ( ) ; foreach ( $ header_object -> namespaces as $ namespace_name => $ namespace_object ) { if ( $ namespace_name == "\\" ) $ namespace_name = "" ; $ namespace_name_cpp = str_replace ( "\\" , "::" , $ namespace_name ) ; $ namespace_name_var = str_replace ( "\\" , "_" , $ namespace_name ) ; foreach ( $ namespace_object -> classes as $ class_name => $ class_object ) { $ constructor_code = "" ; $ virtual_methods_code = "" ; $ properties_init_code = "" ; $ properties_uninit_code = "" ; // Get class declaration code ob_start ( ) ; include ( $ this -> GetTemplatePath ( $ class_name , "" , "declaration" , "classes" , "declaration" ) ) ; $ header_content .= ob_get_contents ( ) ; ob_end_clean ( ) ; $ header_content .= "\n" ; } } // Get footer of header file ob_start ( ) ; include ( $ this -> GetTemplatePath ( $ header_name , "headers" , "footer" , "classes" , "header" ) ) ; $ header_content .= ob_get_contents ( ) ; ob_end_clean ( ) ; } return $ header_content ; }
Generates a specific header file for classes.
@param string $header_name
@return string Source code.
Generates a specific header file for classes .