// JGrep.h // Declaration of main class for NewJ application // This header file should be included before all other classes. // It also, in turn, includes some other basic class declarations, // such as Object and String. #include // TODO: include declarations of superclasses and implemented interfaces // For example, // #include // #include // TODO: include definitions of reference types used in field and method // declarations. Reference type files end in '-ref.h' // For example, // #include // #include // This defines the various references types, including array reference // types, for your main class. // TODO: update this whenever superclass name is changed or names of // implemented interfaces change PIE_DEFINE_DERIVED_REFERENCES(JGrep, ::java::lang::Object); // TODO: specify superclasses and implemented interfaces. // Note that all objects (but not interfaces) must publicly // inherit from one and only one Object-dervied superclass. // This superclass must be listed first. class JGrep : public ::java::lang::Object { public: JGrep(); public: virtual ~JGrep(); // NewJ equivalent of 'void main(String[] args)'. // Note that StringAR is a reference to an array of String objects. // A stands for array, and R stands for reference. public: static void main(::java::lang::StringAR args); private: static void doGrep(::java::lang::StringR fileName, ::java::lang::StringR searchPattern); // This causes your main class to define a Class object for itself, // so its main method may be called dynamically at run-time and // it itself may be dynamically instantiated at run-time. PIE_DECLARE_MAIN_CLASS(); // Hide implicit copy constructor and assignement operator PIE_HIDE_IMPLICIT_METHOD(JGrep); };