Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
unidoc-build committed Aug 23, 2021
1 parent 180c248 commit 27dedcd
Show file tree
Hide file tree
Showing 53 changed files with 19,228 additions and 19,168 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 _gg (_f byte )bool {return _f >='0'&&_f <='9'};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_bb :=make ([]byte ,len (s )*cnt );_dad :=[]byte (s );for _bbb :=0;_bbb < cnt ;_bbb ++{copy (_bb [_bbb :],_dad );};return string (_bb );};
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 );};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_b ,_c :=0,0;for _b < len (lhs )&&_c < len (rhs ){_a :=lhs [_b ];_ad :=rhs [_c ];_e :=_gg (_a );_ed :=_gg (_ad );switch {case _e &&!_ed :return true ;case !_e &&_ed :return false ;case !_e &&!_ed :if _a !=_ad {return _a < _ad ;};_b ++;_c ++;default:_dd :=_b +1;_da :=_c +1;for _dd < len (lhs )&&_gg (lhs [_dd ]){_dd ++;};for _da < len (rhs )&&_gg (rhs [_da ]){_da ++;};_ce ,_ :=_d .ParseUint (lhs [_b :_dd ],10,64);_gf ,_ :=_d .ParseUint (rhs [_b :_da ],10,64);if _ce !=_gf {return _ce < _gf ;};_b =_dd ;_c =_da ;};};return len (lhs )< len (rhs );};
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 );};
664 changes: 332 additions & 332 deletions chart/chart.go

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions color/color.go

Large diffs are not rendered by default.

532 changes: 266 additions & 266 deletions common/common.go

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions common/license/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@
// are valid for the version of UniOffice used.
package license ;import _f "github.com/unidoc/unioffice/internal/license";

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

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};

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

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

// 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 )};const (LicenseTierUnlicensed =_f .LicenseTierUnlicensed ;LicenseTierCommunity =_f .LicenseTierCommunity ;LicenseTierIndividual =_f .LicenseTierIndividual ;LicenseTierBusiness =_f .LicenseTierBusiness ;);

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

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

// LicenseKey represents a loaded license key.
type LicenseKey =_f .LicenseKey ;
// 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 ;);

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

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _f .GetLicenseKey ()};

// 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 )};
24 changes: 12 additions & 12 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 (_de "github.com/unidoc/unioffice/common/tempstorage";_e "io/ioutil";_ec "os";_d "strings";);
package diskstore ;import (_a "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_ba "os";_e "strings";);

// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_g :=diskStorage {};_de .SetAsStorage (&_g )};
// 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 (_a diskStorage )RemoveAll (dir string )error {if _d .HasPrefix (dir ,_ec .TempDir ()){return _ec .RemoveAll (dir );};return nil ;};

// TempFile creates a new temp file by calling ioutil TempFile
func (_db diskStorage )TempFile (dir ,pattern string )(_de .File ,error ){return _e .TempFile (dir ,pattern );};
func (_f diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_ba .TempDir ()){return _ba .RemoveAll (dir );};return nil ;};type diskStorage struct{};

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

// Open opens file from disk according to a path
func (_dc diskStorage )Open (path string )(_de .File ,error ){return _ec .Open (path )};
// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_d :=diskStorage {};_a .SetAsStorage (&_d )};

// Add is not applicable in the diskstore implementation
func (_c diskStorage )Add (path string )error {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 );};

// Open opens file from disk according to a path
func (_bf diskStorage )Open (path string )(_a .File ,error ){return _ba .Open (path )};
38 changes: 19 additions & 19 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 (_d "encoding/hex";_gf "errors";_c "fmt";_a "github.com/unidoc/unioffice/common/tempstorage";_f "io";_gd "io/ioutil";_g "math/rand";_b "sync";);
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";);

// Close is not applicable in this implementation
func (_bdf *memFile )Close ()error {return nil };func _ceb (_ffe int )(string ,error ){_eca :=make ([]byte ,_ffe );if _ ,_ga :=_g .Read (_eca );_ga !=nil {return "",_ga ;};return _d .EncodeToString (_eca ),nil ;};type memFile struct{_cd *memDataCell ;_bd int64 ;};
// 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 ;};

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

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

// TempDir creates a name for a new temp directory using a pattern argument
func (_adc *memStorage )TempDir (pattern string )(string ,error ){return _cb (pattern ),nil };type memDataCell struct{_ee string ;_cg []byte ;_ea int64 ;};
func (_cf *memStorage )TempDir (pattern string )(string ,error ){return _gea (pattern ),nil };

// RemoveAll removes all files according to the dir argument prefix
func (_fba *memStorage )RemoveAll (dir string )error {_fba ._bb .Range (func (_bfc ,_ec interface{})bool {_fba ._bb .Delete (_bfc );return true });return nil ;};func _cb (_ab string )string {_gc ,_ :=_ceb (6);return _ab +_gc };
// 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 ;};

// Open returns tempstorage File object by name
func (_af *memStorage )Open (path string )(_a .File ,error ){_deec ,_fb :=_af ._bb .Load (path );if !_fb {return nil ,_gf .New (_c .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 {_cd :_deec .(*memDataCell )},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 (_fg *memStorage )Add (path string )error {_ ,_ag :=_fg ._bb .Load (path );if _ag {return nil ;};_cdd ,_fe :=_gd .ReadFile (path );if _fe !=nil {return _fe ;};_fg ._bb .Store (path ,&memDataCell {_ee :path ,_cg :_cdd ,_ea :int64 (len (_cdd ))});return nil ;};

// Name returns the filename of the underlying memDataCell
func (_ge *memFile )Name ()string {return _ge ._cd ._ee };
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 ;};

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_ca *memFile )Write (p []byte )(int ,error ){_ca ._cd ._cg =append (_ca ._cd ._cg ,p ...);_ca ._cd ._ea +=int64 (len (p ));return len (p ),nil ;};
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 ;};

// Read reads from the underlying memDataCell in order to implement Reader interface
func (_gfe *memFile )Read (p []byte )(int ,error ){_gfg :=_gfe ._bd ;_de :=_gfe ._cd ._ea ;_eg :=int64 (len (p ));if _eg > _de {_eg =_de ;p =p [:_eg ];};if _gfg >=_de {return 0,_f .EOF ;};_bf :=_gfg +_eg ;if _bf >=_de {_bf =_de ;};_dee :=copy (p ,_gfe ._cd ._cg [_gfg :_bf ]);_gfe ._bd =_bf ;return _dee ,nil ;};
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 ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_eb :=memStorage {_bb :_b .Map {}};_a .SetAsStorage (&_eb )};type memStorage struct{_bb _b .Map };

// TempFile creates a new empty file in the storage and returns it
func (_ad *memStorage )TempFile (dir ,pattern string )(_a .File ,error ){_ae :=dir +"\u002f"+_cb (pattern );_dg :=&memDataCell {_ee :_ae ,_cg :[]byte {}};_ff :=&memFile {_cd :_dg };_ad ._bb .Store (_ae ,_dg );return _ff ,nil ;};
// Close is not applicable in this implementation
func (_ef *memFile )Close ()error {return nil };type memFile struct{_a *memDataCell ;_ae int64 ;};
28 changes: 14 additions & 14 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 _g "io";

// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _a .TempDir (pattern )};type storage interface{Open (_d string )(File ,error );TempFile (_dg ,_da string )(File ,error );TempDir (_df string )(string ,error );RemoveAll (_ce string )error ;Add (_f string )error ;};

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _a .TempFile (dir ,pattern )};
package tempstorage ;import _a "io";

// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_a =newStorage };var _a storage ;
func SetAsStorage (newStorage storage ){_ad =newStorage };

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

// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_g .Reader ;_g .Writer ;_g .Closer ;Name ()string ;};
// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _ad .TempFile (dir ,pattern )};

// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _a .Open (path )};
func Open (path string )(File ,error ){return _ad .Open (path )};

// 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 _a .Add (path )};
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 ;};

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

0 comments on commit 27dedcd

Please sign in to comment.