Ejemplo n.º 1
0
EXC_TYPE CIncStrlBuilder::AddEOS ()
{
	EXC_TYPE	exc=CheckAvailability(1);
	if (exc != EOK)
		return exc;

	*m_lpszCurPos = _T('\0');
	m_lpszCurPos++;
	m_ulCurLen++;

	return EOK;
}
Ejemplo n.º 2
0
Reservation::Reservation(string name,string checkinDate ,string checkoutDate,int numberOfRooms,Room* rooms)
{   CustomerName = name;
    NumberOfRooms = numberOfRooms;
    RequiredRooms = new Room[NumberOfRooms];
    RequiredRooms = rooms;
    CheckInDate = checkinDate;
    CheckOutDate = checkoutDate;

    if(CheckAvailability()){    //if available add customer in residingcustomer database
        addCustomer();
    }
    else generateApology();     //else generate appology
}
Ejemplo n.º 3
0
EXC_TYPE CIncStrlBuilder::Repeat (const TCHAR tch, const UINT32 ulNumReps /* may be zero */)
{
	if (_T('\0') == tch)
		return EPARAM;

	EXC_TYPE	exc=CheckAvailability(ulNumReps);
	if (exc != EOK)
		return exc;

	for (UINT32	rIndex=0; rIndex < ulNumReps; rIndex++, m_lpszCurPos++, m_ulCurLen++)
		*m_lpszCurPos = tch;

	*m_lpszCurPos = _T('\0');	// mark end
	return EOK;
}
Ejemplo n.º 4
0
EXC_TYPE CIncStrlBuilder::AddChars (LPCTSTR lpszChars, const UINT32 ulCLen)
{
	if ((NULL == lpszChars) && (ulCLen != 0))
		return EUDFFORMAT;

	EXC_TYPE	exc=CheckAvailability(ulCLen);
	if (exc != EOK)
		return exc;

	if (ulCLen != 0)
	{
		::_tcsncpy(m_lpszCurPos, lpszChars, ulCLen);
		m_lpszCurPos += ulCLen;
		*m_lpszCurPos = _T('\0');
		m_ulCurLen += ulCLen;
	}

	return EOK;
}