Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.2

# Ignore::Reject( const StrPtr &, const StrPtr & )

Tests whether the provided path will be rejected when it is opened for add because it matches an entry in the provided ignore file.

Virtual? | No |
Class | `Ignore` |
Arguments | `const StrPtr &path` | the path to check
| `const StrPtr &ignoreFile` | the full path to the ignore file
Returns | `int` | nonzero if path is ignored

## Notes

Calling `Reject()` provides a preview of what will happen when files are opened for add.

If the ignore file does not exist, or is not readable, no files are rejected.

## Example

The following example demonstrates the usage of `Reject()`.

    # include "clientapi.h"
    # include "ignore.h"

    int main()
    {
        ClientApi client;
        StrBuf clientPath;

        client.SetIgnoreFile( ".p4ignore" );
        clientPath = "ignore.txt";
        if ( client->GetIgnore()->Reject( *clientPath,
                                          client->GetIgnoreFile() ) )
        {
            printf( "%s is to be ignored.\n", clientPath.Text() );
        }
    }

Your search for returned results