2020-08-27 21:45:09 +00:00
|
|
|
//
|
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
|
|
//
|
|
|
|
// This is a commercial product and requires a license to operate.
|
|
|
|
// A trial license can be obtained at https://unidoc.io
|
|
|
|
//
|
|
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
|
|
|
|
// Package fdf provides support for loading form field data from Form Field Data (FDF) files.
|
2020-10-19 10:58:10 +00:00
|
|
|
package fdf ;import (_e "bufio";_b "bytes";_fa "encoding/hex";_a "errors";_ca "fmt";_bb "github.com/unidoc/unipdf/v3/common";_ff "github.com/unidoc/unipdf/v3/core";_fac "io";_gc "os";_c "regexp";_ga "sort";_aa "strconv";_f "strings";);var _cc =_c .MustCompile ("\u0028\u005c\u0064\u002b)\\\u0073\u002b\u0028\u005c\u0064\u002b\u0029\u005c\u0073\u002b\u006f\u0062\u006a");func (_cfa *fdfParser )parseBool ()(_ff .PdfObjectBool ,error ){_fafd ,_cee :=_cfa ._afd .Peek (4);if _cee !=nil {return _ff .PdfObjectBool (false ),_cee ;};if (len (_fafd )>=4)&&(string (_fafd [:4])=="\u0074\u0072\u0075\u0065"){_cfa ._afd .Discard (4);return _ff .PdfObjectBool (true ),nil ;};_fafd ,_cee =_cfa ._afd .Peek (5);if _cee !=nil {return _ff .PdfObjectBool (false ),_cee ;};if (len (_fafd )>=5)&&(string (_fafd [:5])=="\u0066\u0061\u006cs\u0065"){_cfa ._afd .Discard (5);return _ff .PdfObjectBool (false ),nil ;};return _ff .PdfObjectBool (false ),_a .New ("\u0075n\u0065\u0078\u0070\u0065c\u0074\u0065\u0064\u0020\u0062o\u006fl\u0065a\u006e\u0020\u0073\u0074\u0072\u0069\u006eg");};func (_ccab *fdfParser )parseArray ()(*_ff .PdfObjectArray ,error ){_dcga :=_ff .MakeArray ();_ccab ._afd .ReadByte ();for {_ccab .skipSpaces ();_agc ,_cfc :=_ccab ._afd .Peek (1);if _cfc !=nil {return _dcga ,_cfc ;};if _agc [0]==']'{_ccab ._afd .ReadByte ();break ;};_eaad ,_cfc :=_ccab .parseObject ();if _cfc !=nil {return _dcga ,_cfc ;};_dcga .Append (_eaad );};return _dcga ,nil ;};func (_bfd *fdfParser )parseDict ()(*_ff .PdfObjectDictionary ,error ){_bb .Log .Trace ("\u0052\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0046\u0044\u0046\u0020D\u0069\u0063\u0074\u0021");_ccc :=_ff .MakeDict ();_efg ,_ :=_bfd ._afd .ReadByte ();if _efg !='<'{return nil ,_a .New ("\u0069\u006e\u0076a\u006c\u0069\u0064\u0020\u0064\u0069\u0063\u0074");};_efg ,_ =_bfd ._afd .ReadByte ();if _efg !='<'{return nil ,_a .New ("\u0069\u006e\u0076a\u006c\u0069\u0064\u0020\u0064\u0069\u0063\u0074");};for {_bfd .skipSpaces ();_bfd .skipComments ();_cfd ,_efa :=_bfd ._afd .Peek (2);if _efa !=nil {return nil ,_efa ;};_bb .Log .Trace ("D\u0069c\u0074\u0020\u0070\u0065\u0065\u006b\u003a\u0020%\u0073\u0020\u0028\u0025 x\u0029\u0021",string (_cfd ),string (_cfd ));if (_cfd [0]=='>')&&(_cfd [1]=='>'){_bb .Log .Trace ("\u0045\u004f\u0046\u0020\u0064\u0069\u0063\u0074\u0069o\u006e\u0061\u0072\u0079");_bfd ._afd .ReadByte ();_bfd ._afd .ReadByte ();break ;};_bb .Log .Trace ("\u0050a\u0072s\u0065\u0020\u0074\u0068\u0065\u0020\u006e\u0061\u006d\u0065\u0021");_dad ,_efa :=_bfd .parseName ();_bb .Log .Trace ("\u004be\u0079\u003a\u0020\u0025\u0073",_dad );if _efa !=nil {_bb .Log .Debug ("E\u0052\u0052\u004f\u0052\u0020\u0052e\u0074\u0075\u0072\u006e\u0069\u006e\u0067\u0020\u006ea\u006d\u0065\u0020e\u0072r\u0020\u0025\u0073",_efa );return nil ,_efa ;};if len (_dad )> 4&&_dad [len (_dad )-4:]=="\u006e\u0075\u006c\u006c"{_efb :=_dad [0:len (_dad )-4];_bb .Log .Debug ("\u0054\u0061\u006b\u0069n\u0067\u0020\u0063\u0061\u0072\u0065\u0020\u006f\u0066\u0020n\u0075l\u006c\u0020\u0062\u0075\u0067\u0020\u0028%\u0073\u0029",_dad );_bb .Log .Debug ("\u004e\u0065\u0077\u0020ke\u0079\u0020\u0022\u0025\u0073\u0022\u0020\u003d\u0020\u006e\u0075\u006c\u006c",_efb );_bfd .skipSpaces ();_beaf ,_ :=_bfd ._afd .Peek (1);if _beaf [0]=='/'{_ccc .Set (_efb ,_ff .MakeNull ());continue ;};};_bfd .skipSpaces ();_def ,_efa :=_bfd .parseObject ();if _efa !=nil {return nil ,_efa ;};_ccc .Set (_dad ,_def );_bb .Log .Trace ("\u0064\u0069\u0063\u0074\u005b\u0025\u0073\u005d\u0020\u003d\u0020\u0025\u0073",_dad ,_def .String ());};_bb .Log .Trace ("\u0072\u0065\u0074\u0075rn\u0069\u006e\u0067\u0020\u0046\u0044\u0046\u0020\u0044\u0069\u0063\u0074\u0021");return _ccc ,nil ;};
|
2020-08-27 21:45:09 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// Data represents forms data format (FDF) file data.
|
|
|
|
type Data struct{_bf *_ff .PdfObjectDictionary ;_ed *_ff .PdfObjectArray ;};func (_eeb *fdfParser )getFileOffset ()int64 {_facc ,_ :=_eeb ._ede .Seek (0,_fac .SeekCurrent );_facc -=int64 (_eeb ._afd .Buffered ());return _facc ;};func _acc (_fga _fac .ReadSeeker )(*fdfParser ,error ){_bgaef :=&fdfParser {};_bgaef ._ede =_fga ;_bgaef ._cf =map[int64 ]_ff .PdfObject {};_gbb ,_add ,_dee :=_bgaef .parseFdfVersion ();if _dee !=nil {_bb .Log .Error ("U\u006e\u0061\u0062\u006c\u0065\u0020t\u006f\u0020\u0070\u0061\u0072\u0073\u0065\u0020\u0076e\u0072\u0073\u0069o\u006e:\u0020\u0025\u0076",_dee );return nil ,_dee ;};_bgaef ._eaf =_gbb ;_bgaef ._gd =_add ;_dee =_bgaef .parse ();return _bgaef ,_dee ;};
|
2020-10-05 19:28:24 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// FieldDictionaries returns a map of field names to field dictionaries.
|
|
|
|
func (fdf *Data )FieldDictionaries ()(map[string ]*_ff .PdfObjectDictionary ,error ){_bea :=map[string ]*_ff .PdfObjectDictionary {};for _gg :=0;_gg < fdf ._ed .Len ();_gg ++{_d ,_ec :=_ff .GetDict (fdf ._ed .Get (_gg ));if _ec {_ee ,_ :=_ff .GetString (_d .Get ("\u0054"));if _ee !=nil {_bea [_ee .Str ()]=_d ;};};};return _bea ,nil ;};func (_fcc *fdfParser )parseHexString ()(*_ff .PdfObjectString ,error ){_fcc ._afd .ReadByte ();var _cff _b .Buffer ;for {_bgbc ,_dbd :=_fcc ._afd .Peek (1);if _dbd !=nil {return _ff .MakeHexString (""),_dbd ;};if _bgbc [0]=='>'{_fcc ._afd .ReadByte ();break ;};_dbf ,_ :=_fcc ._afd .ReadByte ();if !_ff .IsWhiteSpace (_dbf ){_cff .WriteByte (_dbf );};};if _cff .Len ()%2==1{_cff .WriteRune ('0');};_bgbg ,_bec :=_fa .DecodeString (_cff .String ());if _bec !=nil {_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u0020\u0050\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0068\u0065\u0078\u0020\u0073\u0074r\u0069\u006e\u0067\u003a\u0020\u0027\u0025\u0073\u0027 \u002d\u0020\u0072\u0065\u0074\u0075\u0072\u006e\u0069\u006e\u0067\u0020\u0061n\u0020\u0065\u006d\u0070\u0074\u0079 \u0073\u0074\u0072i\u006e\u0067",_cff .String ());return _ff .MakeHexString (""),nil ;};return _ff .MakeHexString (string (_bgbg )),nil ;};func (_fgc *fdfParser )parseIndirectObject ()(_ff .PdfObject ,error ){_cea :=_ff .PdfIndirectObject {};_bb .Log .Trace ("\u002dR\u0065a\u0064\u0020\u0069\u006e\u0064i\u0072\u0065c\u0074\u0020\u006f\u0062\u006a");_gac ,_dfb :=_fgc ._afd .Peek (20);if _dfb !=nil {_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0046\u0061\u0069\u006c\u0020\u0074\u006f\u0020r\u0065a\u0064\u0020\u0069\u006e\u0064\u0069\u0072\u0065\u0063\u0074\u0020\u006f\u0062\u006a");return &_cea ,_dfb ;};_bb .Log .Trace ("\u0028\u0069\u006edi\u0072\u0065\u0063\u0074\u0020\u006f\u0062\u006a\u0020\u0070\u0065\u0065\u006b\u0020\u0022\u0025\u0073\u0022",string (_gac ));_bbe :=_cc .FindStringSubmatchIndex (string (_gac ));if len (_bbe )< 6{_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0061\u0062l\u0065\u0020\u0074\u006f \u0066\u0069\u006e\u0064\u0020\u006f\u0062\u006a\u0065\u0063\u0074\u0020\u0073\u0069\u0067\u006e\u0061\u0074\u0075\u0072\u0065\u0020\u0028\u0025\u0073\u0029",string (_gac ));return &_cea ,_a .New ("\u0075\u006e\u0061b\u006c\u0065\u0020\u0074\u006f\u0020\u0064\u0065\u0074\u0065\u0063\u0074\u0020\u0069\u006e\u0064\u0069\u0072\u0065\u0063\u0074\u0020\u006f\u0062\u006a\u0065\u0063\u0074\u0020s\u0069\u0067\u006e\u0061\u0074\u0075\u0072\u0065");};_fgc ._afd .Discard (_bbe [0]);_bb .Log .Trace ("O\u0066\u0066\u0073\u0065\u0074\u0073\u0020\u0025\u0020\u0064",_bbe );_cfbg :=_bbe [1]-_bbe [0];_ebf :=make ([]byte ,_cfbg );_ ,_dfb =_fgc .readAtLeast (_ebf ,_cfbg );if _dfb !=nil {_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0075\u006e\u0061\u0062l\u0065\u0020\u0074\u006f\u0020\u0072\u0065\u0061\u0064\u0020-\u0020\u0025\u0073",_dfb );return nil ,_dfb ;};_bb .Log .Trace ("\u0074\u0065\u0078t\u006c\u0069\u006e\u0065\u003a\u0020\u0025\u0073",_ebf );_fdd :=_cc .FindStringSubmatch (string (_ebf ));if len (_fdd )< 3{_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0061\u0062l\u0065\u0020\u0074\u006f \u0066\u0069\u006e\u0064\u0020\u006f\u0062\u006a\u0065\u0063\u0074\u0020\u0073\u0069\u0067\u006e\u0061\u0074\u0075\u0072\u0065\u0020\u0028\u0025\u0073\u0029",string (_ebf ));return &_cea ,_a .New ("\u0075\u006e\u0061b\u006c\u0065\u0020\u0074\u006f\u0020\u0064\u0065\u0074\u0065\u0063\u0074\u0020\u0069\u006e\u0064\u0069\u0072\u0065\u0063\u0074\u0020\u006f\u0062\u006a\u0065\u0063\u0074\u0020s\u0069\u0067\u006e\u0061\u0074\u0075\u0072\u0065");};_dce ,_ :=_aa .Atoi (_fdd [1]);_ece ,_ :=_aa .Atoi (_fdd [2]);_cea .ObjectNumber =int64 (_dce );_cea .GenerationNumber =int64 (_ece );for {_afb ,_eff :=_fgc ._afd .Peek (2);if _eff !=nil {return &_cea ,_eff ;};_bb .Log .Trace ("I\u006ed\u002e\u0020\u0070\u0065\u0065\u006b\u003a\u0020%\u0073\u0020\u0028\u0025 x\u0029\u0021",string (_afb ),string (_afb ));if _ff .IsWhiteSpace (_afb [0]){_fgc .skipSpaces ();}else if _afb [0]=='%'{_fgc .sk
|
2020-08-27 21:45:09 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// Root returns the Root of the FDF document.
|
|
|
|
func (_bead *fdfParser )Root ()(*_ff .PdfObjectDictionary ,error ){if _bead ._eae !=nil {if _adfd ,_cfab :=_bead .trace (_bead ._eae .Get ("\u0052\u006f\u006f\u0074")).(*_ff .PdfObjectDictionary );_cfab {if _gfa ,_bacb :=_bead .trace (_adfd .Get ("\u0046\u0044\u0046")).(*_ff .PdfObjectDictionary );_bacb {return _gfa ,nil ;};};};var _efc []int64 ;for _adg :=range _bead ._cf {_efc =append (_efc ,_adg );};_ga .Slice (_efc ,func (_dbdf ,_fceg int )bool {return _efc [_dbdf ]< _efc [_fceg ]});for _ ,_bacee :=range _efc {_feb :=_bead ._cf [_bacee ];if _fadb ,_bdd :=_bead .trace (_feb ).(*_ff .PdfObjectDictionary );_bdd {if _gde ,_dcf :=_bead .trace (_fadb .Get ("\u0046\u0044\u0046")).(*_ff .PdfObjectDictionary );_dcf {return _gde ,nil ;};};};return nil ,_a .New ("\u0046\u0044\u0046\u0020\u006e\u006f\u0074\u0020\u0066\u006f\u0075\u006e\u0064");};var _gge =_c .MustCompile ("\u005e\u005b\u005c\u002b\u002d\u002e\u005d\u002a\u0028\u005b\u0030\u002d9\u002e\u005d\u002b\u0029");func (_gcg *fdfParser )trace (_adfe _ff .PdfObject )_ff .PdfObject {switch _geb :=_adfe .(type ){case *_ff .PdfObjectReference :_bgbcb ,_gcab :=_gcg ._cf [_geb .ObjectNumber ].(*_ff .PdfIndirectObject );if _gcab {return _bgbcb .PdfObject ;};_bb .Log .Debug ("\u0054\u0079\u0070\u0065\u0020\u0065\u0072\u0072\u006f\u0072");return nil ;case *_ff .PdfIndirectObject :return _geb .PdfObject ;};return _adfe ;};
|
2020-08-31 21:12:07 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// Load loads FDF form data from `r`.
|
|
|
|
func Load (r _fac .ReadSeeker )(*Data ,error ){_gcf ,_fag :=_acc (r );if _fag !=nil {return nil ,_fag ;};_fe ,_fag :=_gcf .Root ();if _fag !=nil {return nil ,_fag ;};_be ,_ae :=_ff .GetArray (_fe .Get ("\u0046\u0069\u0065\u006c\u0064\u0073"));if !_ae {return nil ,_a .New ("\u0066\u0069\u0065\u006c\u0064\u0073\u0020\u006d\u0069s\u0073\u0069\u006e\u0067");};return &Data {_ed :_be ,_bf :_fe },nil ;};func _bfa (_aeb string )(*fdfParser ,error ){_cfde :=fdfParser {};_acd :=[]byte (_aeb );_ecbf :=_b .NewReader (_acd );_cfde ._ede =_ecbf ;_cfde ._cf =map[int64 ]_ff .PdfObject {};_dgfb :=_e .NewReader (_ecbf );_cfde ._afd =_dgfb ;_cfde ._baa =int64 (len (_aeb ));return &_cfde ,_cfde .parse ();};func (_cfb *fdfParser )parseName ()(_ff .PdfObjectName ,error ){var _faf _b .Buffer ;_edaa :=false ;for {_gdb ,_ab :=_cfb ._afd .Peek (1);if _ab ==_fac .EOF {break ;};if _ab !=nil {return _ff .PdfObjectName (_faf .String ()),_ab ;};if !_edaa {if _gdb [0]=='/'{_edaa =true ;_cfb ._afd .ReadByte ();}else if _gdb [0]=='%'{_cfb .readComment ();_cfb .skipSpaces ();}else {_bb .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u0020N\u0061\u006d\u0065\u0020\u0073\u0074\u0061\u0072\u0074\u0069\u006e\u0067\u0020w\u0069\u0074\u0068\u0020\u0025\u0073\u0020(\u0025\u0020\u0078\u0029",_gdb ,_gdb );return _ff .PdfObjectName (_faf .String ()),_ca .Errorf ("\u0069n\u0076a\u006c\u0069\u0064\u0020\u006ea\u006d\u0065:\u0020\u0028\u0025\u0063\u0029",_gdb [0]);};}else {if _ff .IsWhiteSpace (_gdb [0]){break ;}else if (_gdb [0]=='/')||(_gdb [0]=='[')||(_gdb [0]=='(')||(_gdb [0]==']')||(_gdb [0]=='<')||(_gdb [0]=='>'){break ;}else if _gdb [0]=='#'{_eag ,_fff :=_cfb ._afd .Peek (3);if _fff !=nil {return _ff .PdfObjectName (_faf .String ()),_fff ;};_cfb ._afd .Discard (3);_aafe ,_fff :=_fa .DecodeString (string (_eag [1:3]));if _fff !=nil {return _ff .PdfObjectName (_faf .String ()),_fff ;};_faf .Write (_aafe );}else {_aef ,_ :=_cfb ._afd .ReadByte ();_faf .WriteByte (_aef );};};};return _ff .PdfObjectName (_faf .String ()),nil ;};func (_bece *fdfParser )parseNull ()(_ff .PdfObjectNull ,error ){_ ,_dgc :=_bece ._afd .Discard (4);return _ff .PdfObjectNull {},_dgc ;};func (_dg *fdfParser )readAtLeast (_eef []byte ,_ba int )(int ,error ){_bff :=_ba ;_cad :=0;_gad :=0;for _bff > 0{_gf ,_da :=_dg ._afd .Read (_eef [_cad :]);if _da !=nil {_bb .Log .Debug ("\u0045\u0052\u0052O\u0052\u0020\u0046\u0061i\u006c\u0065\u0064\u0020\u0072\u0065\u0061d\u0069\u006e\u0067\u0020\u0028\u0025\u0064\u003b\u0025\u0064\u0029\u0020\u0025\u0073",_gf ,_gad ,_da .Error ());return _cad ,_a .New ("\u0066\u0061\u0069\u006c\u0065\u0064\u0020\u0072\u0065a\u0064\u0069\u006e\u0067");};_gad ++;_cad +=_gf ;_bff -=_gf ;};return _cad ,nil ;};var _afc =_c .MustCompile ("^\u005c\u0073\u002a\u0028\\d\u002b)\u005c\u0073\u002b\u0028\u005cd\u002b\u0029\u005c\u0073\u002b\u0052");func (_bged *fdfParser )seekFdfVersionTopDown ()(int ,int ,error ){_bged ._ede .Seek (0,_fac .SeekStart );_bged ._afd =_e .NewReader (_bged ._ede );_dfg :=20;_ced :=make ([]byte ,_dfg );for {_cgc ,_fca :=_bged ._afd .ReadByte ();if _fca !=nil {if _fca ==_fac .EOF {break ;}else {return 0,0,_fca ;};};if _ff .IsDecimalDigit (_cgc )&&_ced [_dfg -1]=='.'&&_ff .IsDecimalDigit (_ced [_dfg -2])&&_ced [_dfg -3]=='-'&&_ced [_dfg -4]=='F'&&_ced [_dfg -5]=='D'&&_ced [_dfg -6]=='P'{_bag :=int (_ced [_dfg -2]-'0');_dbac :=int (_cgc -'0');return _bag ,_dbac ,nil ;};_ced =append (_ced [1:_dfg ],_cgc );};return 0,0,_a .New ("\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u0020\u006e\u006f\u0074\u0020f\u006f\u0075\u006e\u0064");};func (_aea *fdfParser )parseString ()(*_ff .PdfObjectString ,error ){_aea ._afd .ReadByte ();var _dea _b .Buffer ;_aec :=1;for {_eg ,_bac :=_aea ._afd .Peek (1);if _bac !=nil {return _ff .MakeString (_dea .String ()),_bac ;};if _eg [0]=='\\'{_aea ._afd .ReadByte ();_fbc ,_bgd :=_aea ._afd .ReadByte ();if _bgd !=nil {return _ff .MakeString (_dea .String ()),_bgd ;};if _ff .IsOctalDigit (_fbc ){_bge ,_dcg :=_aea ._afd .Peek (2);if _dcg !=nil {return _ff .MakeString (_dea .String ()),_dcg ;};var _daag []byte ;_daag =append (_daag ,_fbc );fo
|
2020-10-05 19:28:24 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// FieldValues implements interface model.FieldValueProvider.
|
|
|
|
// Returns a map of field names to values (PdfObjects).
|
|
|
|
func (fdf *Data )FieldValues ()(map[string ]_ff .PdfObject ,error ){_ffe ,_dd :=fdf .FieldDictionaries ();if _dd !=nil {return nil ,_dd ;};var _ad []string ;for _fd :=range _ffe {_ad =append (_ad ,_fd );};_ga .Strings (_ad );_cb :=map[string ]_ff .PdfObject {};for _ ,_af :=range _ad {_ea :=_ffe [_af ];_bc :=_ff .TraceToDirectObject (_ea .Get ("\u0056"));_cb [_af ]=_bc ;};return _cb ,nil ;};type fdfParser struct{_eaf int ;_gd int ;_cf map[int64 ]_ff .PdfObject ;_ede _fac .ReadSeeker ;_afd *_e .Reader ;_baa int64 ;_eae *_ff .PdfObjectDictionary ;};
|
2020-09-07 00:23:12 +00:00
|
|
|
|
2020-10-19 10:58:10 +00:00
|
|
|
// LoadFromPath loads FDF form data from file path `fdfPath`.
|
|
|
|
func LoadFromPath (fdfPath string )(*Data ,error ){_gb ,_fad :=_gc .Open (fdfPath );if _fad !=nil {return nil ,_fad ;};defer _gb .Close ();return Load (_gb );};func (_cg *fdfParser )parseNumber ()(_ff .PdfObject ,error ){return _ff .ParseNumber (_cg ._afd )};func (_ebbe *fdfParser )seekToEOFMarker (_cddf int64 )error {_gec :=int64 (0);_ac :=int64 (1000);for _gec < _cddf {if _cddf <=(_ac +_gec ){_ac =_cddf -_gec ;};_ ,_cfg :=_ebbe ._ede .Seek (-_gec -_ac ,_fac .SeekEnd );if _cfg !=nil {return _cfg ;};_edf :=make ([]byte ,_ac );_ebbe ._ede .Read (_edf );_bb .Log .Trace ("\u004c\u006f\u006f\u006bi\u006e\u0067\u0020\u0066\u006f\u0072\u0020\u0045\u004f\u0046 \u006da\u0072\u006b\u0065\u0072\u003a\u0020\u0022%\u0073\u0022",string (_edf ));_egf :=_gff .FindAllStringIndex (string (_edf ),-1);if _egf !=nil {_ceea :=_egf [len (_egf )-1];_bb .Log .Trace ("\u0049\u006e\u0064\u003a\u0020\u0025\u0020\u0064",_egf );_ebbe ._ede .Seek (-_gec -_ac +int64 (_ceea [0]),_fac .SeekEnd );return nil ;};_bb .Log .Debug ("\u0057\u0061\u0072\u006e\u0069\u006eg\u003a\u0020\u0045\u004f\u0046\u0020\u006d\u0061\u0072\u006b\u0065\u0072\u0020\u006e\u006f\u0074\u0020\u0066\u006f\u0075n\u0064\u0021\u0020\u002d\u0020\u0063\u006f\u006e\u0074\u0069\u006e\u0075\u0065\u0020s\u0065e\u006b\u0069\u006e\u0067");_gec +=_ac ;};_bb .Log .Debug ("\u0045\u0072\u0072\u006f\u0072\u003a\u0020\u0045\u004f\u0046\u0020\u006d\u0061\u0072\u006be\u0072 \u0077\u0061\u0073\u0020\u006e\u006f\u0074\u0020\u0066\u006f\u0075\u006e\u0064\u002e");return _a .New ("\u0045\u004f\u0046\u0020\u006e\u006f\u0074\u0020\u0066\u006f\u0075\u006e\u0064");};
|