test-miniz.nut 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. local txt = [==[
  2. UKCompaniesHouseRegisteredNumber|08270000|00000827
  3. EntityCurrentLegalOrRegisteredName|current-period|BRAHMAPOOTRA TEA COMPANY LIMITED
  4. BalanceSheetDate|current-mud|2013-12-31
  5. EntityDormant|current-period|false
  6. StartDateForPeriodCoveredByReport|current-mud|2013-01-01
  7. EndDateForPeriodCoveredByReport|current-mud|2013-12-31
  8. EntityTrading|current-period|true
  9. Debtors|current-mud|197,994
  10. Debtors|previous-mud|197,994
  11. CurrentAssets|current-mud|197,994
  12. CurrentAssets|previous-mud|197,994
  13. CreditorsDueWithinOneYear|current-mud|83,494
  14. CreditorsDueWithinOneYear|previous-mud|83,494
  15. NetCurrentAssetsLiabilities|current-mud|114,500
  16. NetCurrentAssetsLiabilities|previous-mud|114,500
  17. TotalAssetsLessCurrentLiabilities|current-mud|114,500
  18. TotalAssetsLessCurrentLiabilities|previous-mud|114,500
  19. NetAssetsLiabilitiesIncludingPensionAssetLiability|current-mud|114,500
  20. NetAssetsLiabilitiesIncludingPensionAssetLiability|previous-mud|114,500
  21. CalledUpShareCapital|current-mud|114,500
  22. CalledUpShareCapital|previous-mud|114,500
  23. ShareholderFunds|current-mud|114,500
  24. ShareholderFunds|previous-mud|114,500
  25. CompanyEntitledToExemptionUnderSection477CompaniesAct2006|current-period|For the year ending 31 December 2013 the company was entitled to exemption under section 477 of the Companies Act 2006 relating to small companies.
  26. MembersHaveNotRequiredCompanyToObtainAnAudit|current-period|The members have not required the company to obtain an audit in accordance with section 476 of the Companies Act 2006.
  27. DirectorsAcknowledgeTheirResponsibilitiesUnderCompaniesAct|current-period|The directors acknowledge their responsibilities for complying with the requirements of the Act with respect to accounting records and the preparation of accounts.
  28. AccountsAreInAccordanceWithSpecialProvisionsCompaniesActRelatingToSmallCompanies|current-period|These accounts have been prepared in accordance with the provisions applicable to companies subject to the small companies regime.
  29. DateApprovalAccounts|current-mud|27 January 2014
  30. NameEntityOfficer|current-period-director1|V K Mundhra
  31. ]==];
  32. local zipedTxt = zlib.deflate(txt);
  33. //zipedTxt = miniz.deflate(txt);
  34. local unzipedTxt = zlib.inflate(zipedTxt);
  35. print(txt.len(), zipedTxt.len(), unzipedTxt.len(), unzipedTxt == txt);
  36. /*
  37. zipedTxt = miniz.deflate(txt);
  38. //zipedTxt = zlib.deflate(txt);
  39. unzipedTxt = miniz.inflate(zipedTxt);
  40. print(txt.len(), zipedTxt.len(), unzipedTxt.len(), unzipedTxt == txt);
  41. local za = miniz.ZipArchive("/home/mingo/dev/companies-uk/Accounts_Monthly_Data-January2014.zip");
  42. local file_count = za.get_num_files();
  43. print(file_count);
  44. for(local i=0; i < file_count; ++i)
  45. {
  46. print(za.get_file_name(i), za.get_file_size(i));
  47. }
  48. za.destroy();
  49. */
  50. local uza = zlib.Unzip("/home/mingo/dev/companies-uk/Accounts_Monthly_Data-January2014.zip");
  51. local file_count = uza.get_num_files();
  52. print(__LINE__, file_count);
  53. print(uza.goto_first_file());
  54. local x = 0;
  55. do
  56. {
  57. local finfo = uza.get_file_info();
  58. print(finfo.name,finfo.size, finfo.is_dir);
  59. if(x == 0)
  60. {
  61. print(uza.extract_file());
  62. }
  63. ++x;
  64. } while(uza.goto_next_file());
  65. uza.destroy();