Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
UppHub
Status & Roadmap
FAQ
Authors & License
Forums
Funding U++
Search on this site











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

One

 

Demonstrates the usage of One

 

 

One.cpp

 

#include <Core/Core.h>

 

using namespace Upp;

 

void DumpFile(One<Stream>& s)

{

    LOG("=========");

    int ii = 0;

    while(!s->IsEof())

        LOG(++ii << ": " << s->GetLine());

}

 

CONSOLE_APP_MAIN

{

    String fn = GetDataFile("One.cpp");

    {

        One<Stream> s;

        s.Create<FileIn>(fn);

        DumpFile(s);

    }

    {

        One<Stream> s = MakeOne<FileIn>(fn);

        DumpFile(s);

    }

}

 

 

 

 

Do you want to contribute?