windows-nt/Source/XPSP1/NT/enduser/speech/tts/truetalk/backend/beversion.cpp
2020-09-26 16:20:57 +08:00

66 lines
1.6 KiB
C++

/******************************************************************************
* BeVersion.cpp *
*---------------*
*
*------------------------------------------------------------------------------
* Copyright (C) 1998 Entropic, Inc
* Copyright (C) 2000 Microsoft Corporation Date: 03/02/00
* All Rights Reserved
*
********************************************************************* PACOG ***/
#include "BeVersion.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
const char * const BendVersion::pszVersion = "2.3.0";
/*****************************************************************************
* BendVersion::WriteVersionString *
*---------------------------------*
* Description:
*
******************************************************************* PACOG ***/
void BendVersion::WriteVersionString( FILE* fp)
{
assert (fp);
if (fp )
{
fprintf (fp, "%s\n", pszVersion);
}
}
/*****************************************************************************
* BendVersion::CheckVersionString *
*---------------------------------*
* Description:
*
******************************************************************* PACOG ***/
bool BendVersion::CheckVersionString( FILE* fp)
{
char str[_MAX_PATH+1];
char* ptr;
assert (fp);
if (fp && fgets(str, _MAX_PATH, fp))
{
ptr = (str + strlen(str)-1); // Strip last carriage return
if ( *ptr == '\n')
{
*ptr = '\0';
}
if (strcmp(str, pszVersion) == 0)
{
return true;
}
}
return false;
}