예제 #1
0
int main()
{
    Mycode::Vector<int> intVector(2);
    Mycode::Vector<char> charVector(2);
    Mycode::Vector<double> doubleVector(2);
    Mycode::Vector<float> floatVector(2);


    //Mycode::print_vector(intVector);
    std::cout << charVector;

    // calling the variadic.
    //printVectors(intVector, charVector, doubleVector, floatVector);

    Mycode::Vector<int> copy(intVector);
    // printVectors(copy);

    Mycode::LessThan<int>  t(42);

    if(!t(43))
    {
	std::cout << "Obviously 42 is not less than 43." << std::endl;
    }

    std::cout << Mycode::countLessThan(intVector, t) << std::endl;

}
예제 #2
0
void Message::SetSubject(const std::wstring& subject) const
{
    if(subject.empty())
    {
        LOG_WS_ERROR(L"Subject value empty");
        return;
    }

	std::wostringstream msg;
	msg << "Set MAIL_SUBJECT_ITEM = [" << subject.c_str() << "]" << std::ends;
	LOG_WS_INFO(msg.str().c_str());
	
	std::string lmbcsString = Workshare::Conversions::W22LMBCS(subject.c_str());		
	std::vector<char> charVector(lmbcsString.begin(), lmbcsString.end());
	std::for_each(charVector.begin(), charVector.end() - 1, ConvertLineFeedCharToNullChar());
	
	STATUS status = NSFItemSetText(m_noteHandle, MAIL_SUBJECT_ITEM, &charVector[0], (WORD)charVector.size());
	if(LNNOERROR != status)
	{
		LOG_WS_ERROR(L"Failed to set the 'Subject' of a notes message");
	}
}