Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE void U_EXPORT2 u_versionToString ( UVersionInfo  versionArray,
char *  versionString 
)

Write a string with dotted-decimal version information according to the input UVersionInfo. Definition of this function lives in putil.c

Parameters:
versionArray The version information to be written as a string.
versionString A string buffer that will be filled in with a string corresponding to the numeric version information in versionArray. The buffer size must be at least U_MAX_VERSION_STRING_LENGTH. ICU 2.4

Definition at line 1919 of file putil.c.

References NULL, and U_VERSION_DELIMITER.

                                                                  {
    uint16_t count, part;
    uint8_t field;

    if(versionString==NULL) {
        return;
    }

    if(versionArray==NULL) {
        versionString[0]=0;
        return;
    }

    /* count how many fields need to be written */
    for(count=4; count>0 && versionArray[count-1]==0; --count) {
    }

    if(count <= 1) {
        count = 2;
    }

    /* write the first part */
    /* write the decimal field value */
    field=versionArray[0];
    if(field>=100) {
        *versionString++=(char)('0'+field/100);
        field%=100;
    }
    if(field>=10) {
        *versionString++=(char)('0'+field/10);
        field%=10;
    }
    *versionString++=(char)('0'+field);

    /* write the following parts */
    for(part=1; part<count; ++part) {
        /* write a dot first */
        *versionString++=U_VERSION_DELIMITER;

        /* write the decimal field value */
        field=versionArray[part];
        if(field>=100) {
            *versionString++=(char)('0'+field/100);
            field%=100;
        }
        if(field>=10) {
            *versionString++=(char)('0'+field/10);
            field%=10;
        }
        *versionString++=(char)('0'+field);
    }

    /* NUL-terminate */
    *versionString=0;
}


Generated by  Doxygen 1.6.0   Back to index