SOL9 Sample: UrlCacheEntryFinder

SOL9 2.0 Samples

1 Screenshot


2 Source code

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



// SOL9
// 2012/01/10

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


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

  const TCHAR* xmlFile = argv[2];

  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;
  }

  Locale locale;

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

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

Last modified: 2 May 2016

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