Back to index

salome-kernel  6.5.0
Functions
duplicate.cxx File Reference
#include <stdlib.h>
#include <string.h>
#include "utilities.h"
#include "OpUtil.hxx"

Go to the source code of this file.

Functions

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

Function Documentation

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 ;
}

Here is the caller graph for this function: