uICAL icon indicating copy to clipboard operation
uICAL copied to clipboard

Suggest there may be errors in the Readme documentation example

Open orthogonaleety opened this issue 3 months ago • 3 comments

Probably only because I don't have a clue what I'm doing I came to be paying attention to the C++ STL example in the Readme.md . However, for clueless people going back to basics can be very useful for understanding problems. While using the example in the Readme, it caused me a number of issues mostly and especially because being so clueless I was convinced that with the number of issues, that the issue was me and something about compile options I didn't get.

I'm afraid I don't know what I'm doing enough to contribute directly to the project, so please find my suggestions below.

I believe uICAL::DateTime begin("20191016T102000Z"), should end in a semicolon uICAL::DateTime begin("20191016T102000Z");

std::cout << calIt->current() << std:endl; has a typo for the syntax '::' for identifying the member std::cout << calIt->current() << std::endl;

It might also be kind to add a comment suggesting the include below. Although, I note the comment about using alternative libraries for the target platforms.

//#include <fstream>

It might also be kind to have main return type int rather than be void, again I can see that may be too specific? I don't know, I'm clueless.

void main () { becoming int main () {

orthogonaleety avatar Aug 29 '25 18:08 orthogonaleety

Many thanks for your input, very much appreciated!!

sourcesimian avatar Aug 30 '25 10:08 sourcesimian

Thanks for your previous acknowledgement sourcesimian.

Not an error, but I don't think the following addition warrants a separate issue given the 'suggestion' nature of my previous contribution.

For the example's test ical "ical1.txt"

the example's range

uICAL::DateTime begin("20191016T102000Z");
uICAL::DateTime begin("20191016T102000Z");

would return no events.

It may again be kinder to use some range such as:

uICAL::DateTime begin("20190901T102000Z");
uICAL::DateTime end("20190931T103000Z");

or some other test ical.

Less important, is that for easy sense, it may be kinder to retrieve some specific property in the while loop, such as:

    while (calIt->next()) {
        std::cout << calIt->current()->summary() << std::endl;
        std::cout << calIt->current()->start().as_str() << std::endl;
    }

(although to be honest I still haven't really tried to look into what just current() actually returns, such that it can be covered by << and output.) Many thanks for everybody's time again.

orthogonaleety avatar Sep 06 '25 17:09 orthogonaleety

  • Offered a couple of pull requests #22 and #23, in case it's of any 'material' help.

#23 includes that of #22, but #23 is of more dubious value.

That said I expect it would be easier to just make the changes rather than review my contribution. Still, never know.

Feel free to bin the requests, any criticism, including regarding collaboration procedure welcome, and no doubt more than warranted.

orthogonaleety avatar Sep 08 '25 16:09 orthogonaleety