Back to index

salome-kernel  6.5.0
Functions
OpUtil.hxx File Reference
#include "SALOME_Utils.hxx"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

UTILS_EXPORT const char * duplicate (const char *const)
 This function can be changed by strdup() if strdup() is ANSI.

Function Documentation

UTILS_EXPORT const char* duplicate ( const char *const  str)

This function can be changed by strdup() if strdup() is ANSI.

It is strongly (and only) used in the Registry environment (RegistryService, RegistryConnexion, Identity, ...)

Definition at line 42 of file duplicate.cxx.

{
        ASSERT(str!=NULL) ;
        const size_t length = strlen( str ) ;
        ASSERT(length>0) ;
        char *new_str = new char[ 1+length ] ;
        ASSERT(new_str) ;
        strcpy( new_str , str ) ;
        return new_str ;
}