#!/usr/bin/perl

use strict;

my $filename = $ARGV [ 0 ];

if ( -e $filename )
{
    die "File `$filename' exists.\n";
}

open ( OUT, ">$filename" );

my $defines_file_name_macro;

$defines_file_name_macro = "DEFINES_ISLIB_$filename";
$defines_file_name_macro =~ tr/[a-z]/[A-Z]/;
$defines_file_name_macro =~ s/\./_/g;

$filename =~ /([a-zA-Z0-9_]+)\..pp/;

my $class_name = $1;

if ( $filename =~ /[a-zA-Z0-9_]+\.hpp/ )
{
    print OUT <<EOT
#ifndef $defines_file_name_macro

#define $defines_file_name_macro

//
// Inclusion of standard header file
//

//
// Inclusion of system header file
//

//
// Inclusion of library header file
//

//
// Inclusion of local header file
//

namespace islib
  {
    //
    // Declaration of class
    //

    //
    // Definition of class
    //
    class $class_name
      {
        //
        // Declaration of friend
        //

      public:
        //
        // Definition of type
        //
        typedef $class_name this_type;

        //
        // Declaration of constructor
        //
        $class_name ( /* TODO:  */ );

        //
        // Declaration of destructor
        //
        ~$class_name () throw ();

        //
        // Declaration of operator
        //
        this_type &operator = ( this_type const & );

        //
        // Declaration of method
        //
        /* TODO:  */ get_/* TODO:  */ () const;
        bool is_null () const;
        void set_/* TODO:  */ ( /* TODO:  */ );
        void swap ( this_type & ) throw ();

        //
        // Declaration of static method
        //

      protected:
        //
        // Declaration of constructor
        //
        $class_name ();

        //
        // Declaration of member function
        //

        //
        // Declaration of static member function
        //

      private:
        //
        // Declaration of data member
        //

        //
        // Declaration of member function
        //

        //
        // Declaration of static member function
        //

      };
  }

#endif // $defines_file_name_macro

//
// End of file
//
EOT
    ;
}
elsif ( $filename =~ /[a-zA-Z0-9_]+\.cpp/ )
{
    print OUT <<EOT
//
// Inclusion of standard header file
//

//
// Inclusion of system header file
//

//
// Inclusion of library header file
//

//
// Inclusion of local header file
//
#include "$class_name.hpp"

namespace islib
  {
    //
    // Declaration of class
    //

    //
    // Definition of constructor
    //
    $class_name\:\:$class_name
      (
      ):
      // TODO:
      {
      }

    //
    // Definition of constructor
    //
    $class_name\:\:$class_name
      (
        // TODO:
      ):
      // TODO:
      {
        class local
          {
          public:
            local
              (
                // TODO:
              ):
              /* TODO:  */ ( /* TODO:  */ )
              {
                throw_if ( std\:\:invalid_argument ( "islib\:\:$class_name\:\:$class_name: TODO: " ), /* TODO:  */ );
              }

            ~local
              (
              )
              throw
                (
                )
              {
              }

          private:
            // TODO:
          }
        a_local ( /* TODO:  */ );
      }

    //
    // Definition of constructor
    //
    $class_name\:\:$class_name
      (
        this_type const &the_other
      ):
      // TODO:
      {
      }

    //
    // Definition of destructor
    //
    $class_name\:\:~$class_name
      (
      )
      throw
        (
        )
      {
      }

    //
    // Definition of operator
    //
    $class_name\:\:this_type &
    $class_name\:\:operator =
      (
        this_type const &right_value
      )
      {
        this_type temporary ( right_value );

        this->swap ( temporary );

        return *this;
      }

    //
    // Definition of method
    //
    $class_name\:\:/* TODO:  */
    $class_name\:\:get_/* TODO:  */
      (
      )
      const
      {
        /* TODO:  */ /* TODO:  */;

        class local
          {
          public:
            local
              (
                /* TODO:  */ const &/* TODO:  */
              ):
              /* TODO:  */ ( /* TODO:  */ )
              {
              }

            ~local
              (
              )
              throw
                (
                )
              {
                assert_ ( /* TODO:  */, "islib\:\:$class_name\:\:get_TODO: : `TODO: ' has failed." );
              }

          private:
            /* TODO:  */ const &/* TODO:  */;
          }
        a_local ( /* TODO:  */ );

        // TODO:

        return /* TODO:  */;
      }

    //
    // Definition of method
    //
    bool
    $class_name\:\:is_null
      (
      )
      const
      {
        // TODO:

        return /* TODO:  */;
      }

    //
    // Definition of method
    //
    void
    $class_name\:\:set_/* TODO:  */
      (
        /* TODO:  */ /* TODO:  */
      )
      {
        class local
          {
          public:
            local
              (
                /* TODO:  */ /* TODO:  */
              ):
              /* TODO:  */ ( /* TODO:  */ )
              {
                throw_if ( std\:\:invalid_argument ( "islib\:\:$class_name\:\:set_TODO: : TODO: " ), /* TODO:  */ );
              }

            ~local
              (
              )
              throw
                (
                )
              {
              }

          private:
            /* TODO:  */ /* TODO:  */;
          }
        a_local ( /* TODO:  */ );

        // TODO:
      }

    //
    // Definition of method
    //
    void
    $class_name\:\:swap
      (
        this_type &the_other
      )
      throw
        (
        )
      {
        // TODO:
      }
  }

//
// End of file
//
EOT
    ;
}
else
{
    print OUT "";
}

close ( OUT );

0;
