Package org.eigenbase.resgen

# Class CppGenerator

java.lang.Object
org.eigenbase.resgen.AbstractGenerator
org.eigenbase.resgen.CppGenerator

All Implemented Interfaces:
  `Generator`

Direct Known Subclasses:
  `CppHeaderGenerator`

class CppGenerator extends AbstractGenerator
Generates a C++ class containing resource definitions.

Since:
  19 September, 2005
Version:
  $Id: //open/util/resgen/src/org/eigenbase/resgen/CppGenerator.java#3 $
Author:
  jhyde

## Constructor Summary

Constructors
Constructor
Description
`CppGenerator(File srcFile, File file, String className, String baseClassName, String defaultExceptionClassName, String headerFilename)`
Creates a C++ header generator.

## Method Summary

Modifier and Type
Method
Description
`void`
`generateModule(ResourceGen generator, ResourceDef.ResourceBundle resourceList, PrintWriter pw)`
Generates a class containing a line for each resource.
`void`
`generateResource(ResourceDef.Resource resource, PrintWriter pw)`
Generates code for a particular resource.
`protected String[]`
`getArgTypes(String message)`
Returns the number and types of parameters in the given error message, expressed as an array of Strings (legal values are currently "String", "Number", "java.util.Date", and null) ordered by parameter number.
`protected String`
`getBaseClassName()`
Returns the fully-qualified name of the base class.
`protected String`
`getClassName()`
Returns the fully-qualified name of the class being generated, for example "happy.BirthdayResource_en_US".

### Methods inherited from class org.eigenbase.resgen.AbstractGenerator

`generateDoNotModifyHeader, generateGeneratedByBlock, getArgumentList, getFile, getParameterList, getSrcFileForComment, setScmSafeComments, useScmSafeComments`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### CppGenerator

CppGenerator(File srcFile, File file, String className, String baseClassName, String defaultExceptionClassName, String headerFilename)
Creates a C++ header generator.

Parameters:
  `srcFile` -
  `file` -
  `className` -
  `baseClassName` - Name of base class, must not be null, typically
  `defaultExceptionClassName` -

## Method Details

### getClassName

protected String getClassName()
Description copied from class: `AbstractGenerator`
Returns the fully-qualified name of the class being generated, for example "happy.BirthdayResource_en_US".

Specified by:
  `getClassName` in class `AbstractGenerator`

### getBaseClassName

protected String getBaseClassName()
Description copied from class: `AbstractGenerator`
Returns the fully-qualified name of the base class.

Specified by:
  `getBaseClassName` in class `AbstractGenerator`

### getArgTypes

protected String[] getArgTypes(String message)
Description copied from class: `AbstractGenerator`
Returns the number and types of parameters in the given error message, expressed as an array of Strings (legal values are currently "String", "Number", "java.util.Date", and null) ordered by parameter number.

Specified by:
  `getArgTypes` in class `AbstractGenerator`

### generateModule

public void generateModule(ResourceGen generator, ResourceDef.ResourceBundle resourceList, PrintWriter pw)
Description copied from interface: `Generator`
Generates a class containing a line for each resource.

### generateResource

public void generateResource(ResourceDef.Resource resource, PrintWriter pw)
Description copied from class: `AbstractGenerator`
Generates code for a particular resource.

Specified by:
  `generateResource` in class `AbstractGenerator`