예제 #1
0
void	oImgBitmap::getContents(EXTfldval &pContents) {
	if (mImage == NULL) {
		pContents.setEmpty(fftBinary, 0);		
	} else {
		int				len = 0;
		unsigned char *	pngdata = mImage->asPNG(len);

		if (pngdata == NULL) {
			oBaseComponent::addToTraceLog("getContents: No image");
			pContents.setEmpty(fftBinary, 0);		
		} else {
			pContents.setBinary(fftBinary, pngdata, len);

			free(pngdata);
		};
	};
};
예제 #2
0
// This method sets up the passed in EXTfldval with a date representing the ISO8601 Date passed in
void OmnisTools::getEXTfldvalFromISO8601DateString(EXTfldval& fVal, std::string dateString) {

    boost::smatch theMatch;
    datestamptype theDate;
    
    if( boost::regex_match(dateString,theMatch,datetimeCheck) ) { 
        // Match date/time
        fVal.setEmpty(fftDate, dpFdtimeC);
        fVal.getDate(theDate);
        
        theDate.mDateOk = qtrue;
        theDate.mYear = lexical_cast<qshort>(theMatch[1]);  // First match is year
        theDate.mMonth = (char) lexical_cast<qshort>(theMatch[2]);  // Second match is month
        theDate.mDay = (char) lexical_cast<qshort>(theMatch[3]);  // Third match is day
        
        theDate.mTimeOk = qtrue;
        theDate.mHour = (char) lexical_cast<qshort>(theMatch[4]);  // Fourth match is hour
        theDate.mMin = (char) lexical_cast<qshort>(theMatch[5]);  // Fifth match is minute
        
        theDate.mSecOk = qfalse;
        theDate.mHunOk = qfalse;
        
        // Optional matches
        if (theMatch[6].matched && theMatch[6].length() > 0) {
            // Appears to have the seconds portion
            theDate.mSecOk = qtrue;
            theDate.mSec = lexical_cast<int>(theMatch[6]);  // Sixth match is seconds
        }
        
        fVal.setDate(theDate, dpFdtimeC);
        
    } else if ( boost::regex_match(dateString,theMatch,dateCheck) ) {
        // Match date
        fVal.setEmpty(fftDate, dpFdate2000);
        fVal.getDate(theDate);
        
        theDate.mDateOk = qtrue;
        theDate.mYear = lexical_cast<qshort>(theMatch[1]);  // First match is year
        theDate.mMonth = (char) lexical_cast<qshort>(theMatch[2]);  // Second match is month
        theDate.mDay = (char) lexical_cast<qshort>(theMatch[3]);  // Third match is day
        
        theDate.mTimeOk = qfalse;
        theDate.mSecOk = qfalse;
        theDate.mHunOk = qfalse;
        
        fVal.setDate(theDate, dpFdate2000);
        
    } else if ( boost::regex_match(dateString,theMatch,timeCheck) ) {
        // Match time
        fVal.setEmpty(fftDate, dpFtime);
        fVal.getDate(theDate);
        
        theDate.mDateOk = qfalse;
        theDate.mTimeOk = qtrue;
        theDate.mHour = (char) lexical_cast<qshort>(theMatch[1]);  // First match is hour
        theDate.mMin = (char) lexical_cast<qshort>(theMatch[2]);  // Second match is minute
        
        theDate.mSecOk = qfalse;
        theDate.mHunOk = qfalse;
        
        // Optional matches
        if (theMatch[3].matched && theMatch[3].length() > 0) {
            // Appears to have the seconds portion
            theDate.mSecOk = qtrue;
            theDate.mSec = (char) lexical_cast<qshort>(theMatch[3]);  // Third match is seconds
        }
        
        fVal.setDate(theDate);
    }
}
예제 #3
0
void	oImgLayer::getContents(EXTfldval &pContents) {
	pContents.setEmpty(fftBinary, 0);
};