SOL9 Sample: UrlCacheSourceUrlFinder

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * UrlCacheSourceUrlFinder.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */



// SOL9
// 2012/01/10

#include <sol/Locale.h>
#include <sol/String.h>
#include <sol/wininet/UrlCacheSourceUrlFinder.h>
#include <sol/FileWriter.h>

void _tmain(int argc, const TCHAR* argv[])
{
  if (argc != 3) {
    _tprintf(_T("Usage: %s visited|cookie|all xmlFile\n"), argv[0]);
    return;
  }


  const String entryType = argv[1];

  if (!(entryType.equalsIgnoreCase(_T("visited")) ||
        entryType.equalsIgnoreCase(_T("cookie")) ||
        entryType.equalsIgnoreCase(_T("all")) ) ){
      _tprintf(_T("Invalid argument: %s\nPlease specify cache type as 'visited' or 'cookie' or 'all'.\n"), argv[1]);
    return;
  }

  const TCHAR* xmlFile = argv[2];

  Locale locale;

  try {
    FileWriter writer(xmlFile);
    writer.writeln(L"<?xml version=\"1.0\" encoding=\"UTF-16\"?>");
    UrlCacheSourceUrlFinder cacheFinder;
    cacheFinder.find(entryType, writer);

  } catch (...) {
    printf("Exception\n");
  }
}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.