|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.core.CConventions
public class CConventions
Constructor Summary | |
---|---|
CConventions()
|
Method Summary | |
---|---|
static boolean |
isLegalIdentifier(java.lang.String name)
|
static boolean |
isValidIdentifier(java.lang.String name)
|
static org.eclipse.core.runtime.IStatus |
validateClassName(java.lang.String name)
Validate the given CPP class name, either simple or qualified. |
static org.eclipse.core.runtime.IStatus |
validateEnumName(java.lang.String name)
Validate the given CPP enum name, either simple or qualified. |
static org.eclipse.core.runtime.IStatus |
validateFieldName(java.lang.String name)
Validate the given field name. |
static org.eclipse.core.runtime.IStatus |
validateFileName(java.lang.String name)
Validate the given file name. |
static org.eclipse.core.runtime.IStatus |
validateHeaderFileName(org.eclipse.core.resources.IProject project,
java.lang.String name)
Validate the given header file name. |
static org.eclipse.core.runtime.IStatus |
validateIdentifier(java.lang.String id)
Validate the given C identifier. |
static org.eclipse.core.runtime.IStatus |
validateIncludeName(org.eclipse.core.resources.IProject project,
java.lang.String name)
Validate the given include name. |
static org.eclipse.core.runtime.IStatus |
validateMethodName(java.lang.String name)
Validate the given method name. |
static org.eclipse.core.runtime.IStatus |
validateNamespaceName(java.lang.String name)
Validate the given CPP namespace name, either simple or qualified. |
static org.eclipse.core.runtime.IStatus |
validateScopeName(java.lang.String name)
Validate the given scope name. |
static org.eclipse.core.runtime.IStatus |
validateSourceFileName(org.eclipse.core.resources.IProject project,
java.lang.String name)
Validate the given source file name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CConventions()
Method Detail |
---|
public static boolean isLegalIdentifier(java.lang.String name)
public static org.eclipse.core.runtime.IStatus validateClassName(java.lang.String name)
"A::B::C"
, or "C"
.
name
- the name of a class
IStatus.OK
if
the given name is valid as a CPP class name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the namepublic static org.eclipse.core.runtime.IStatus validateNamespaceName(java.lang.String name)
"A::B::C"
, or "C"
.
name
- the name of a namespace
IStatus.OK
if
the given name is valid as a CPP class name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the namepublic static org.eclipse.core.runtime.IStatus validateScopeName(java.lang.String name)
IStatus.OK
if
the given name is valid as a class name, otherwise a status
object indicating what is wrong with the namepublic static org.eclipse.core.runtime.IStatus validateFieldName(java.lang.String name)
Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3).
For example, "x"
.
name
- the name of a field
IStatus.OK
if
the given name is valid as a field name, otherwise a status
object indicating what is wrong with the namepublic static org.eclipse.core.runtime.IStatus validateIdentifier(java.lang.String id)
"true"
, "false"
), or null literal ("null"
).
See section 3.8 of the C Language Specification, Second Edition (JLS2).
A valid identifier can act as a simple type name, method name or field name.
id
- the C identifier
IStatus.OK
if
the given identifier is a valid C identifier, otherwise a status
object indicating what is wrong with the identifierpublic static org.eclipse.core.runtime.IStatus validateMethodName(java.lang.String name)
The syntax for a method name is defined by Identifier of MethodDeclarator (JLS2 8.4). For example "println".
name
- the name of a method
IStatus.OK
if
the given name is valid as a method name, otherwise a status
object indicating what is wrong with the namepublic static org.eclipse.core.runtime.IStatus validateIncludeName(org.eclipse.core.resources.IProject project, java.lang.String name)
The name of an include without the surroounding double quotes or brakets
For example, stdio.h
or iostream
.
name
- the include declaration
IStatus.OK
if
the given name is valid as an include name, otherwise a status
object indicating what is wrong with the namepublic static boolean isValidIdentifier(java.lang.String name)
public static org.eclipse.core.runtime.IStatus validateFileName(java.lang.String name)
name
- the file name
IStatus.OK
if
the given name is valid as a C/C++ file name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the namepublic static org.eclipse.core.runtime.IStatus validateHeaderFileName(org.eclipse.core.resources.IProject project, java.lang.String name)
name
- the header file name
IStatus.OK
if
the given name is valid as a C/C++ header file name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the namepublic static org.eclipse.core.runtime.IStatus validateSourceFileName(org.eclipse.core.resources.IProject project, java.lang.String name)
name
- the source file name
IStatus.OK
if
the given name is valid as a C/C++ source file name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the namepublic static org.eclipse.core.runtime.IStatus validateEnumName(java.lang.String name)
"A::B::C"
, or "C"
.
name
- the name of a enum
IStatus.OK
if
the given name is valid as a CPP enum name,
a status with code IStatus.WARNING
indicating why the given name is discouraged,
otherwise a status object indicating what is wrong with
the name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |