org.eclipse.cdt.core.model

## Interface ICContainer

All Superinterfaces:
  IBufferChangedListener, ICElement, IOpenable, IParent

All Known Subinterfaces:
  ISourceRoot

    public interface ICContainer
    extends ICElement, IParent, IOpenable

A C folder resource.

### Field Summary

### Fields inherited from interface org.eclipse.cdt.core.model.ICElement

`ASM_LABEL, C_ARCHIVE, C_BINARY, C_CCONTAINER, C_CLASS, C_CLASS_CTOR, C_CLASS_DECLARATION, C_CLASS_DTOR, C_ENUMERATION, C_ENUMERATOR, C_FIELD, C_FUNCTION, C_FUNCTION_DECLARATION, C_INCLUDE, C_MACRO, C_METHOD, C_METHOD_DECLARATION, C_MODEL, C_NAMESPACE, C_PROJECT, C_STORAGE_EXTERN, C_STORAGE_STATIC, C_STRUCT, C_STRUCT_DECLARATION, C_TEMPLATE_CLASS, C_TEMPLATE_CLASS_DECLARATION, C_TEMPLATE_FUNCTION, C_TEMPLATE_FUNCTION_DECLARATION, C_TEMPLATE_METHOD, C_TEMPLATE_METHOD_DECLARATION, C_TEMPLATE_STRUCT, C_TEMPLATE_STRUCT_DECLARATION, C_TEMPLATE_UNION, C_TEMPLATE_UNION_DECLARATION, C_TEMPLATE_VARIABLE, C_TYPEDEF, C_UNION, C_UNION_DECLARATION, C_UNIT, C_UNKNOWN_DECLARATION, C_USING, C_VARIABLE, C_VARIABLE_DECLARATION, C_VARIABLE_LOCAL, C_VCONTAINER, CPP_FRIEND, CPP_PRIVATE, CPP_PROTECTED, CPP_PUBLIC, EMPTY_ARRAY`

### Method Summary

All Methods Instance Methods Abstract Methods
`IArchive` `getArchive(java.lang.String name)` This is a handle-only operation.
`IArchive[]` `getArchives()` Returns all the archives of this container.
`IBinary[]` `getBinaries()` Returns the all the binaries of this container.
`IBinary` `getBinary(java.lang.String name)` Returns the binary for this name, it must be a valid binary.
`ICContainer` `getCContainer(java.lang.String name)` Returns the container with the given name.
`ICContainer[]` `getCContainers()` Returns all the child containers of this container.
`java.lang.Object[]` `getNonCResources()` Returns an array of non-C resources directly contained in this project.
`IContainer` `getResource()` Returns the corresponding IContainer.
`ITranslationUnit` `getTranslationUnit(java.lang.String name)` Returns the translation unit with the specified name in this container (for example, `"foobar.c"`).
`ITranslationUnit[]` `getTranslationUnits()` Returns all of the translation units in this ccontainer.

### Methods inherited from interface org.eclipse.cdt.core.model.ICElement

`accept, exists, getAncestor, getCModel, getCProject, getElementName, getElementType, getHandleIdentifier, getLocationURI, getParent, getPath, getUnderlyingResource, isReadOnly, isStructureKnown`

### Methods inherited from interface org.eclipse.cdt.core.model.IParent

`getChildren, getChildrenOfType, hasChildren`

### Methods inherited from interface org.eclipse.cdt.core.model.IOpenable

`close, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, makeConsistent, open, save`

### Methods inherited from interface org.eclipse.cdt.core.model.IBufferChangedListener

`bufferChanged`

### Method Detail

#### getNonCResources

    java.lang.Object[] getNonCResources()
                                 throws CModelException

Returns an array of non-C resources directly contained in this project. It does not transitively answer non-C resources contained in folders; these would have to be explicitly iterated over.

Non-C resources includes files, folders, projects not accounted for.

Returns:
  an array of non-C resources directly contained in this project
Throws:
  `CModelException` - if this element does not exist or if an exception occurs while accessing its corresponding resource

#### getTranslationUnits

    ITranslationUnit[] getTranslationUnits()
                                    throws CModelException

Returns all of the translation units in this ccontainer.

Returns:
  all of the translation units in this ccontainer
Throws:
  `CModelException` - if this element does not exist or if an exception occurs while accessing its corresponding resource.

#### getTranslationUnit

    ITranslationUnit getTranslationUnit(java.lang.String name)

Returns the translation unit with the specified name in this container (for example, `"foobar.c"`). The name has to be a valid translation unit name. This is a handle-only operation. The celement may or may not exist.

Parameters:
  `name` - the given name
Returns:
  the translation unit with the specified name in this container

#### getBinaries

    IBinary[] getBinaries()
                   throws CModelException

Returns the all the binaries of this container.

Throws:
  `CModelException`

#### getBinary

    IBinary getBinary(java.lang.String name)

Returns the binary for this name, it must be a valid binary. This is a handle-only operation. The container may or may not exist.

#### getArchives

    IArchive[] getArchives()
                    throws CModelException

Returns all the archives of this container.

Throws:
  `CModelException`

#### getArchive

    IArchive getArchive(java.lang.String name)

This is a handle-only operation. The container may or may not exist.

#### getCContainers

    ICContainer[] getCContainers()
                          throws CModelException

Returns all the child containers of this container.

Throws:
  `CModelException`

#### getCContainer

    ICContainer getCContainer(java.lang.String name)

Returns the container with the given name. An empty string indicates the default package. This is a handle-only operation. The celement may or may not exist.

Parameters:
  `name` - the name of a nested container
Returns:
  the container with the given name

#### getResource

    IContainer getResource()

Returns the corresponding IContainer.

Specified by:
  `getResource` in interface `ICElement`
Returns:
  the corresponding resource, or `null` if none
Since:
  5.9