ultimatepp/tutorial/Ntl12/Ntl12.cpp
cxl 0e04c59abc cpp11 branch - committing the merge (rest of it)
git-svn-id: svn://ultimatepp.org/upp/trunk@7048 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2014-03-16 16:35:29 +00:00

27 lines
437 B
C++

#include <Core/Core.h>
using namespace Upp;
void Do(Any& x)
{
if(x.Is<String>())
LOG("String: " << x.Get<String>());
if(x.Is<FileIn>()) {
LOG("--- File: ");
LOG(LoadStream(x.Get<FileIn>()));
LOG("----------");
}
if(x.IsEmpty())
LOG("empty");
}
CONSOLE_APP_MAIN
{
Any x;
x.Create<String>() = "Hello!";
Do(x);
x.Create<FileIn>().Open(GetDataFile("Ntl12.cpp"));
Do(x);
x.Clear();
Do(x);
}