Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
unidoc-build committed Sep 22, 2021
1 parent 44cbafe commit fa02d82
Show file tree
Hide file tree
Showing 53 changed files with 18,967 additions and 18,917 deletions.
4 changes: 2 additions & 2 deletions algo/algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// 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 algo ;import _d "strconv";func _e (_c byte )bool {return _c >='0'&&_c <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_cc :=make ([]byte ,len (s )*cnt );_ba :=[]byte (s );for _dea :=0;_dea < cnt ;_dea ++{copy (_cc [_dea :],_ba );};return string (_cc );};
package algo ;import _b "strconv";func _ba (_d byte )bool {return _d >='0'&&_d <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_g :=make ([]byte ,len (s )*cnt );_ddc :=[]byte (s );for _bg :=0;_bg < cnt ;_bg ++{copy (_g [_bg :],_ddc );};return string (_g );};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_eg ,_a :=0,0;for _eg < len (lhs )&&_a < len (rhs ){_g :=lhs [_eg ];_da :=rhs [_a ];_f :=_e (_g );_de :=_e (_da );switch {case _f &&!_de :return true ;case !_f &&_de :return false ;case !_f &&!_de :if _g !=_da {return _g < _da ;};_eg ++;_a ++;default:_cg :=_eg +1;_cd :=_a +1;for _cg < len (lhs )&&_e (lhs [_cg ]){_cg ++;};for _cd < len (rhs )&&_e (rhs [_cd ]){_cd ++;};_fb ,_ :=_d .ParseUint (lhs [_eg :_cg ],10,64);_ad ,_ :=_d .ParseUint (rhs [_eg :_cd ],10,64);if _fb !=_ad {return _fb < _ad ;};_eg =_cg ;_a =_cd ;};};return len (lhs )< len (rhs );};
func NaturalLess (lhs ,rhs string )bool {_dd ,_a :=0,0;for _dd < len (lhs )&&_a < len (rhs ){_f :=lhs [_dd ];_fd :=rhs [_a ];_fb :=_ba (_f );_ef :=_ba (_fd );switch {case _fb &&!_ef :return true ;case !_fb &&_ef :return false ;case !_fb &&!_ef :if _f !=_fd {return _f < _fd ;};_dd ++;_a ++;default:_ec :=_dd +1;_fc :=_a +1;for _ec < len (lhs )&&_ba (lhs [_ec ]){_ec ++;};for _fc < len (rhs )&&_ba (rhs [_fc ]){_fc ++;};_eg ,_ :=_b .ParseUint (lhs [_dd :_ec ],10,64);_dc ,_ :=_b .ParseUint (rhs [_dd :_fc ],10,64);if _eg !=_dc {return _eg < _dc ;};_dd =_ec ;_a =_fc ;};};return len (lhs )< len (rhs );};
660 changes: 330 additions & 330 deletions chart/chart.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions color/color.go

Large diffs are not rendered by default.

530 changes: 265 additions & 265 deletions common/common.go

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

// Package license helps manage commercial licenses and check if they
// are valid for the version of UniOffice used.
package license ;import _f "github.com/unidoc/unioffice/internal/license";
package license ;import _g "github.com/unidoc/unioffice/internal/license";

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_f .LegacyLicense ;
type LegacyLicense =_g .LegacyLicense ;

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _f .MakeUnlicensedKey ()};
// LicenseKey represents a loaded license key.
type LicenseKey =_g .LicenseKey ;

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _g .SetLicenseKey (content ,customerName );};

// LegacyLicenseType is the type of license
type LegacyLicenseType =_f .LegacyLicenseType ;
type LegacyLicenseType =_g .LegacyLicenseType ;

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _f .SetLicenseKey (content ,customerName );};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _g .GetLicenseKey ()};

// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _g .SetMeteredKey (apiKey )};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _g .MakeUnlicensedKey ()};

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_f .MeteredStatus ,error ){return _f .GetMeteredState ()};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};
func GetMeteredState ()(_g .MeteredStatus ,error ){return _g .GetMeteredState ()};const (LicenseTierUnlicensed =_g .LicenseTierUnlicensed ;LicenseTierCommunity =_g .LicenseTierCommunity ;LicenseTierIndividual =_g .LicenseTierIndividual ;LicenseTierBusiness =_g .LicenseTierBusiness ;);

// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
func SetLegacyLicenseKey (s string )error {return _f .SetLegacyLicenseKey (s )};

// LicenseKey represents a loaded license key.
type LicenseKey =_f .LicenseKey ;

// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
func SetMeteredKey (apiKey string )error {return _f .SetMeteredKey (apiKey )};
func SetLegacyLicenseKey (s string )error {return _g .SetLegacyLicenseKey (s )};
18 changes: 9 additions & 9 deletions common/tempstorage/diskstore/diskstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@

// Package diskstore implements tempStorage interface
// by using disk as a storage
package diskstore ;import (_a "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_ba "os";_e "strings";);
package diskstore ;import (_c "github.com/unidoc/unioffice/common/tempstorage";_f "io/ioutil";_a "os";_bb "strings";);

// Add is not applicable in the diskstore implementation
func (_de diskStorage )Add (path string )error {return nil };

// RemoveAll removes all files in the directory
func (_f diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_ba .TempDir ()){return _ba .RemoveAll (dir );};return nil ;};type diskStorage struct{};
func (_d diskStorage )Add (path string )error {return nil };

// TempFile creates a new temp directory by calling ioutil TempDir
func (_bg diskStorage )TempDir (pattern string )(string ,error ){return _b .TempDir ("",pattern )};
func (_e diskStorage )TempDir (pattern string )(string ,error ){return _f .TempDir ("",pattern )};

// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_d :=diskStorage {};_a .SetAsStorage (&_d )};
func SetAsStorage (){_g :=diskStorage {};_c .SetAsStorage (&_g )};

// RemoveAll removes all files in the directory
func (_cc diskStorage )RemoveAll (dir string )error {if _bb .HasPrefix (dir ,_a .TempDir ()){return _a .RemoveAll (dir );};return nil ;};

// TempFile creates a new temp file by calling ioutil TempFile
func (_eg diskStorage )TempFile (dir ,pattern string )(_a .File ,error ){return _b .TempFile (dir ,pattern );};
func (_fa diskStorage )TempFile (dir ,pattern string )(_c .File ,error ){return _f .TempFile (dir ,pattern );};type diskStorage struct{};

// Open opens file from disk according to a path
func (_bf diskStorage )Open (path string )(_a .File ,error ){return _ba .Open (path )};
func (_bg diskStorage )Open (path string )(_c .File ,error ){return _a .Open (path )};
40 changes: 20 additions & 20 deletions common/tempstorage/memstore/memstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@

// Package memstore implements tempStorage interface
// by using memory as a storage
package memstore ;import (_gc "encoding/hex";_f "errors";_cb "fmt";_fg "github.com/unidoc/unioffice/common/tempstorage";_cd "io";_cdc "io/ioutil";_g "math/rand";_d "sync";);
package memstore ;import (_c "encoding/hex";_gf "errors";_gb "fmt";_b "github.com/unidoc/unioffice/common/tempstorage";_g "io";_d "io/ioutil";_e "math/rand";_gg "sync";);

// TempFile creates a new empty file in the storage and returns it
func (_ba *memStorage )TempFile (dir ,pattern string )(_fg .File ,error ){_bcc :=dir +"\u002f"+_gea (pattern );_db :=&memDataCell {_fgd :_bcc ,_bc :[]byte {}};_af :=&memFile {_a :_db };_ba ._bb .Store (_bcc ,_db );return _af ,nil ;};
// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_ce :=memStorage {_ece :_gg .Map {}};_b .SetAsStorage (&_ce )};

// TempDir creates a name for a new temp directory using a pattern argument
func (_ef *memStorage )TempDir (pattern string )(string ,error ){return _fgc (pattern ),nil };type memDataCell struct{_ecd string ;_cb []byte ;_ggb int64 ;};

// Close is not applicable in this implementation
func (_bg *memFile )Close ()error {return nil };

// Name returns the filename of the underlying memDataCell
func (_dd *memFile )Name ()string {return _dd ._a ._fgd };func _gea (_ca string )string {_fce ,_ :=_cag (6);return _ca +_fce };
func (_dac *memFile )Name ()string {return _dac ._bb ._ecd };func _fgc (_ccg string )string {_ffe ,_ :=_dfb (6);return _ccg +_ffe };

// Open returns tempstorage File object by name
func (_bf *memStorage )Open (path string )(_fg .File ,error ){_be ,_cdb :=_bf ._bb .Load (path );if !_cdb {return nil ,_f .New (_cb .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_a :_be .(*memDataCell )},nil ;};type memStorage struct{_bb _d .Map };type memDataCell struct{_fgd string ;_bc []byte ;_gg int64 ;};
// Read reads from the underlying memDataCell in order to implement Reader interface
func (_bf *memFile )Read (p []byte )(int ,error ){_da :=_bf ._dd ;_fd :=_bf ._bb ._ggb ;_bd :=int64 (len (p ));if _bd > _fd {_bd =_fd ;p =p [:_bd ];};if _da >=_fd {return 0,_g .EOF ;};_gd :=_da +_bd ;if _gd >=_fd {_gd =_fd ;};_cc :=copy (p ,_bf ._bb ._cb [_da :_gd ]);_bf ._dd =_gd ;return _cc ,nil ;};

// TempDir creates a name for a new temp directory using a pattern argument
func (_cf *memStorage )TempDir (pattern string )(string ,error ){return _gea (pattern ),nil };
// Open returns tempstorage File object by name
func (_fe *memStorage )Open (path string )(_b .File ,error ){_ba ,_baa :=_fe ._ece .Load (path );if !_baa {return nil ,_gf .New (_gb .Sprintf ("\u0043\u0061\u006eno\u0074\u0020\u006f\u0070\u0065\u006e\u0020\u0074\u0068\u0065\u0020\u0066\u0069\u006c\u0065\u0020\u0025\u0073",path ));};return &memFile {_bb :_ba .(*memDataCell )},nil ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_ada :=memStorage {_bb :_d .Map {}};_fg .SetAsStorage (&_ada )};func _cag (_aee int )(string ,error ){_bdb :=make ([]byte ,_aee );if _ ,_caf :=_g .Read (_bdb );_caf !=nil {return "",_caf ;};return _gc .EncodeToString (_bdb ),nil ;};
// TempFile creates a new empty file in the storage and returns it
func (_ceb *memStorage )TempFile (dir ,pattern string )(_b .File ,error ){_bgc :=dir +"\u002f"+_fgc (pattern );_fg :=&memDataCell {_ecd :_bgc ,_cb :[]byte {}};_ed :=&memFile {_bb :_fg };_ceb ._ece .Store (_bgc ,_fg );return _ed ,nil ;};func _dfb (_ga int )(string ,error ){_db :=make ([]byte ,_ga );if _ ,_ecee :=_e .Read (_db );_ecee !=nil {return "",_ecee ;};return _c .EncodeToString (_db ),nil ;};

// RemoveAll removes all files according to the dir argument prefix
func (_da *memStorage )RemoveAll (dir string )error {_da ._bb .Range (func (_ggb ,_de interface{})bool {_da ._bb .Delete (_ggb );return true });return nil ;};

// Add reads a file from a disk and adds it to the storage
func (_df *memStorage )Add (path string )error {_ ,_bd :=_df ._bb .Load (path );if _bd {return nil ;};_ed ,_fc :=_cdc .ReadFile (path );if _fc !=nil {return _fc ;};_df ._bb .Store (path ,&memDataCell {_fgd :path ,_bc :_ed ,_gg :int64 (len (_ed ))});return nil ;};
func (_ff *memStorage )RemoveAll (dir string )error {_ff ._ece .Range (func (_de ,_a interface{})bool {_ff ._ece .Delete (_de );return true });return nil ;};type memStorage struct{_ece _gg .Map };

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_b *memFile )Write (p []byte )(int ,error ){_b ._a ._bc =append (_b ._a ._bc ,p ...);_b ._a ._gg +=int64 (len (p ));return len (p ),nil ;};
func (_ec *memFile )Write (p []byte )(int ,error ){_ec ._bb ._cb =append (_ec ._bb ._cb ,p ...);_ec ._bb ._ggb +=int64 (len (p ));return len (p ),nil ;};

// Read reads from the underlying memDataCell in order to implement Reader interface
func (_e *memFile )Read (p []byte )(int ,error ){_ce :=_e ._ae ;_gcc :=_e ._a ._gg ;_ge :=int64 (len (p ));if _ge > _gcc {_ge =_gcc ;p =p [:_ge ];};if _ce >=_gcc {return 0,_cd .EOF ;};_ad :=_ce +_ge ;if _ad >=_gcc {_ad =_gcc ;};_eg :=copy (p ,_e ._a ._bc [_ce :_ad ]);_e ._ae =_ad ;return _eg ,nil ;};

// Close is not applicable in this implementation
func (_ef *memFile )Close ()error {return nil };type memFile struct{_a *memDataCell ;_ae int64 ;};
// Add reads a file from a disk and adds it to the storage
func (_dg *memStorage )Add (path string )error {_ ,_fc :=_dg ._ece .Load (path );if _fc {return nil ;};_ge ,_ea :=_d .ReadFile (path );if _ea !=nil {return _ea ;};_dg ._ece .Store (path ,&memDataCell {_ecd :path ,_cb :_ge ,_ggb :int64 (len (_ge ))});return nil ;};type memFile struct{_bb *memDataCell ;_dd int64 ;};
30 changes: 15 additions & 15 deletions common/tempstorage/tempstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
// 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 tempstorage ;import _a "io";
package tempstorage ;import _df "io";

// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_ad =newStorage };
// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _dec .Add (path )};

// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_df .Reader ;_df .Writer ;_df .Closer ;Name ()string ;};

// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _ad .RemoveAll (dir )};
func RemoveAll (dir string )error {return _dec .RemoveAll (dir )};var _dec storage ;

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _ad .TempFile (dir ,pattern )};
// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _dec .TempDir (pattern )};

// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _ad .Open (path )};
func Open (path string )(File ,error ){return _dec .Open (path )};type storage interface{Open (_c string )(File ,error );TempFile (_de ,_g string )(File ,error );TempDir (_f string )(string ,error );RemoveAll (_dd string )error ;Add (_a string )error ;};

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _ad .TempDir (pattern )};

// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _ad .Add (path )};var _ad storage ;type storage interface{Open (_g string )(File ,error );TempFile (_c ,_e string )(File ,error );TempDir (_ca string )(string ,error );RemoveAll (_b string )error ;Add (_ee string )error ;};
// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_dec =newStorage };

// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_a .Reader ;_a .Writer ;_a .Closer ;Name ()string ;};
// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _dec .TempFile (dir ,pattern )};
18 changes: 9 additions & 9 deletions document/convert/convert.go

Large diffs are not rendered by default.

Loading

0 comments on commit fa02d82

Please sign in to comment.