Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
unidoc-build committed May 31, 2021
1 parent 9dd5d3a commit d1a3042
Show file tree
Hide file tree
Showing 50 changed files with 18,902 additions and 18,899 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 _e "strconv";
package algo ;import _b "strconv";func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_dd :=make ([]byte ,len (s )*cnt );_ab :=[]byte (s );for _gc :=0;_gc < cnt ;_gc ++{copy (_dd [_gc :],_ab );};return string (_dd );};func _d (_bf byte )bool {return _bf >='0'&&_bf <='9'};

// NaturalLess compares two strings in a human manner so rId2 sorts less than rId10
func NaturalLess (lhs ,rhs string )bool {_ff ,_ab :=0,0;for _ff < len (lhs )&&_ab < len (rhs ){_fc :=lhs [_ff ];_ee :=rhs [_ab ];_gg :=_g (_fc );_d :=_g (_ee );switch {case _gg &&!_d :return true ;case !_gg &&_d :return false ;case !_gg &&!_d :if _fc !=_ee {return _fc < _ee ;};_ff ++;_ab ++;default:_c :=_ff +1;_eb :=_ab +1;for _c < len (lhs )&&_g (lhs [_c ]){_c ++;};for _eb < len (rhs )&&_g (rhs [_eb ]){_eb ++;};_fff ,_ :=_e .ParseUint (lhs [_ff :_c ],10,64);_dd ,_ :=_e .ParseUint (rhs [_ff :_eb ],10,64);if _fff !=_dd {return _fff < _dd ;};_ff =_c ;_ab =_eb ;};};return len (lhs )< len (rhs );};func RepeatString (s string ,cnt int )string {if cnt <=0{return "";};_ggc :=make ([]byte ,len (s )*cnt );_b :=[]byte (s );for _ea :=0;_ea < cnt ;_ea ++{copy (_ggc [_ea :],_b );};return string (_ggc );};func _g (_a byte )bool {return _a >='0'&&_a <='9'};
func NaturalLess (lhs ,rhs string )bool {_bd ,_gd :=0,0;for _bd < len (lhs )&&_gd < len (rhs ){_a :=lhs [_bd ];_gb :=rhs [_gd ];_aa :=_d (_a );_be :=_d (_gb );switch {case _aa &&!_be :return true ;case !_aa &&_be :return false ;case !_aa &&!_be :if _a !=_gb {return _a < _gb ;};_bd ++;_gd ++;default:_ag :=_bd +1;_c :=_gd +1;for _ag < len (lhs )&&_d (lhs [_ag ]){_ag ++;};for _c < len (rhs )&&_d (rhs [_c ]){_c ++;};_e ,_ :=_b .ParseUint (lhs [_bd :_ag ],10,64);_bdc ,_ :=_b .ParseUint (rhs [_bd :_c ],10,64);if _e !=_bdc {return _e < _bdc ;};_bd =_ag ;_gd =_c ;};};return len (lhs )< len (rhs );};
664 changes: 332 additions & 332 deletions chart/chart.go

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions color/color.go

Large diffs are not rendered by default.

538 changes: 269 additions & 269 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 _a "github.com/unidoc/unioffice/internal/license";const (LicenseTierUnlicensed =_a .LicenseTierUnlicensed ;LicenseTierCommunity =_a .LicenseTierCommunity ;LicenseTierIndividual =_a .LicenseTierIndividual ;LicenseTierBusiness =_a .LicenseTierBusiness ;);
package license ;import _g "github.com/unidoc/unioffice/internal/license";

// 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 _a .SetMeteredKey (apiKey )};
func SetMeteredKey (apiKey string )error {return _g .SetMeteredKey (apiKey )};

// 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 _a .SetLegacyLicenseKey (s )};
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_g .MeteredStatus ,error ){return _g .GetMeteredState ()};

// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _a .GetLicenseKey ()};
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _g .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_g .LicenseTierUnlicensed ;LicenseTierCommunity =_g .LicenseTierCommunity ;LicenseTierIndividual =_g .LicenseTierIndividual ;LicenseTierBusiness =_g .LicenseTierBusiness ;);

// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _a .SetLicenseKey (content ,customerName );};
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_g .LegacyLicense ;

// LicenseKey represents a loaded license key.
type LicenseKey =_a .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 =_a .LegacyLicenseType ;
type LegacyLicenseType =_g .LegacyLicenseType ;

// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_a .MeteredStatus ,error ){return _a .GetMeteredState ()};
// LicenseKey represents a loaded license key.
type LicenseKey =_g .LicenseKey ;

// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_a .LegacyLicense ;
// GetLicenseKey returns the currently loaded license key.
func GetLicenseKey ()*LicenseKey {return _g .GetLicenseKey ()};

// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _a .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 _g .SetLegacyLicenseKey (s )};
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 (_ce "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_c "os";_f "strings";);

// Open opens file from disk according to a path
func (_e diskStorage )Open (path string )(_ce .File ,error ){return _c .Open (path )};type diskStorage struct{};
package diskstore ;import (_fa "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_g "os";_e "strings";);

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

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

// Add is not applicable in the diskstore implementation
func (_cc diskStorage )Add (path string )error {return nil };
// Open opens file from disk according to a path
func (_ag diskStorage )Open (path string )(_fa .File ,error ){return _g .Open (path )};type diskStorage struct{};

// RemoveAll removes all files in the directory
func (_fd diskStorage )RemoveAll (dir string )error {if _f .HasPrefix (dir ,_c .TempDir ()){return _c .RemoveAll (dir );};return nil ;};
func (_ef diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_g .TempDir ()){return _g .RemoveAll (dir );};return nil ;};

// TempFile creates a new temp file by calling ioutil TempFile
func (_ae diskStorage )TempFile (dir ,pattern string )(_ce .File ,error ){return _b .TempFile (dir ,pattern );};
func (_ae diskStorage )TempFile (dir ,pattern string )(_fa .File ,error ){return _b .TempFile (dir ,pattern );};

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

// Add is not applicable in the diskstore implementation
func (_bb diskStorage )Add (path string )error {return nil };
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 (_e "encoding/hex";_gg "errors";_d "fmt";_ggb "github.com/unidoc/unioffice/common/tempstorage";_ac "io";_g "io/ioutil";_f "math/rand";_c "sync";);type memFile struct{_ff *memDataCell ;_db int64 ;};
package memstore ;import (_af "encoding/hex";_b "errors";_c "fmt";_dc "github.com/unidoc/unioffice/common/tempstorage";_a "io";_d "io/ioutil";_ee "math/rand";_e "sync";);type memStorage struct{_de _e .Map };

// Add reads a file from a disk and adds it to the storage
func (_gda *memStorage )Add (path string )error {_ ,_ag :=_gda ._gf .Load (path );if _ag {return nil ;};_gee ,_ce :=_g .ReadFile (path );if _ce !=nil {return _ce ;};_gda ._gf .Store (path ,&memDataCell {_dc :path ,_gc :_gee ,_fb :int64 (len (_gee ))});return nil ;};
// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_ef :=memStorage {_de :_e .Map {}};_dc .SetAsStorage (&_ef )};type memDataCell struct{_gc string ;_ba []byte ;_ac int64 ;};

// TempDir creates a name for a new temp directory using a pattern argument
func (_ea *memStorage )TempDir (pattern string )(string ,error ){return _cb (pattern ),nil };
// TempFile creates a new empty file in the storage and returns it
func (_dca *memStorage )TempFile (dir ,pattern string )(_dc .File ,error ){_ded :=dir +"\u002f"+_cc (pattern );_fc :=&memDataCell {_gc :_ded ,_ba :[]byte {}};_gd :=&memFile {_ad :_fc };_dca ._de .Store (_ded ,_fc );return _gd ,nil ;};

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_dd *memFile )Write (p []byte )(int ,error ){_dd ._ad ._ba =append (_dd ._ad ._ba ,p ...);_dd ._ad ._ac +=int64 (len (p ));return len (p ),nil ;};

// Name returns the filename of the underlying memDataCell
func (_ga *memFile )Name ()string {return _ga ._ff ._dc };
func (_eec *memFile )Name ()string {return _eec ._ad ._gc };

// Read reads from the underlying memDataCell in order to implement Reader interface
func (_b *memFile )Read (p []byte )(int ,error ){_ggg :=_b ._db ;_cc :=_b ._ff ._fb ;_fg :=int64 (len (p ));if _fg > _cc {_fg =_cc ;p =p [:_fg ];};if _ggg >=_cc {return 0,_ac .EOF ;};_ffg :=_ggg +_fg ;if _ffg >=_cc {_ffg =_cc ;};_fc :=copy (p ,_b ._ff ._gc [_ggg :_ffg ]);_b ._db =_ffg ;return _fc ,nil ;};func _gce (_bc int )(string ,error ){_fga :=make ([]byte ,_bc );if _ ,_cbf :=_f .Read (_fga );_cbf !=nil {return "",_cbf ;};return _e .EncodeToString (_fga ),nil ;};type memDataCell struct{_dc string ;_gc []byte ;_fb int64 ;};
// Add reads a file from a disk and adds it to the storage
func (_fga *memStorage )Add (path string )error {_ ,_cg :=_fga ._de .Load (path );if _cg {return nil ;};_efe ,_da :=_d .ReadFile (path );if _da !=nil {return _da ;};_fga ._de .Store (path ,&memDataCell {_gc :path ,_ba :_efe ,_ac :int64 (len (_efe ))});return nil ;};func _bae (_edd int )(string ,error ){_eea :=make ([]byte ,_edd );if _ ,_eee :=_ee .Read (_eea );_eee !=nil {return "",_eee ;};return _af .EncodeToString (_eea ),nil ;};

// Open returns tempstorage File object by name
func (_dbc *memStorage )Open (path string )(_ggb .File ,error ){_cg ,_ge :=_dbc ._gf .Load (path );if !_ge {return nil ,_gg .New (_d .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 {_ff :_cg .(*memDataCell )},nil ;};
// Read reads from the underlying memDataCell in order to implement Reader interface
func (_fe *memFile )Read (p []byte )(int ,error ){_ff :=_fe ._dg ;_ae :=_fe ._ad ._ac ;_eg :=int64 (len (p ));if _eg > _ae {_eg =_ae ;p =p [:_eg ];};if _ff >=_ae {return 0,_a .EOF ;};_ffa :=_ff +_eg ;if _ffa >=_ae {_ffa =_ae ;};_g :=copy (p ,_fe ._ad ._ba [_ff :_ffa ]);_fe ._dg =_ffa ;return _g ,nil ;};func _cc (_dde string )string {_fd ,_ :=_bae (6);return _dde +_fd };

// RemoveAll removes all files according to the dir argument prefix
func (_fff *memStorage )RemoveAll (dir string )error {_fff ._gf .Range (func (_ccf ,_dd interface{})bool {_fff ._gf .Delete (_ccf );return true });return nil ;};func _cb (_bb string )string {_ef ,_ :=_gce (6);return _bb +_ef };type memStorage struct{_gf _c .Map };

// TempFile creates a new empty file in the storage and returns it
func (_gaa *memStorage )TempFile (dir ,pattern string )(_ggb .File ,error ){_fd :=dir +"\u002f"+_cb (pattern );_aa :=&memDataCell {_dc :_fd ,_gc :[]byte {}};_ae :=&memFile {_ff :_aa };_gaa ._gf .Store (_fd ,_aa );return _ae ,nil ;};
func (_cb *memStorage )RemoveAll (dir string )error {_cb ._de .Range (func (_cbb ,_aa interface{})bool {_cb ._de .Delete (_cbb );return true });return nil ;};type memFile struct{_ad *memDataCell ;_dg int64 ;};

// Write writes to the end of the underlying memDataCell in order to implement Writer interface
func (_ec *memFile )Write (p []byte )(int ,error ){_ec ._ff ._gc =append (_ec ._ff ._gc ,p ...);_ec ._ff ._fb +=int64 (len (p ));return len (p ),nil ;};
// Open returns tempstorage File object by name
func (_bb *memStorage )Open (path string )(_dc .File ,error ){_fg ,_acb :=_bb ._de .Load (path );if !_acb {return nil ,_b .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 {_ad :_fg .(*memDataCell )},nil ;};

// SetAsStorage sets temp storage as a memory storage
func SetAsStorage (){_gd :=memStorage {_gf :_c .Map {}};_ggb .SetAsStorage (&_gd )};
// TempDir creates a name for a new temp directory using a pattern argument
func (_be *memStorage )TempDir (pattern string )(string ,error ){return _cc (pattern ),nil };

// Close is not applicable in this implementation
func (_fgg *memFile )Close ()error {return nil };
func (_ed *memFile )Close ()error {return nil };
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 _gd "io";
package tempstorage ;import _f "io";

// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_gd .Reader ;_gd .Writer ;_gd .Closer ;Name ()string ;};var _df storage ;type storage interface{Open (_d string )(File ,error );TempFile (_e ,_dg string )(File ,error );TempDir (_ee string )(string ,error );RemoveAll (_c 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 _b .TempFile (dir ,pattern )};

// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _df .RemoveAll (dir )};
// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _b .Open (path )};

// Add reads a file from a disk and adds it to the storage.
func Add (path string )error {return _df .Add (path )};
func Add (path string )error {return _b .Add (path )};

// Open returns tempstorage File object by name.
func Open (path string )(File ,error ){return _df .Open (path )};
// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _b .TempDir (pattern )};

// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_df =newStorage };
// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _b .RemoveAll (dir )};type storage interface{Open (_fg string )(File ,error );TempFile (_c ,_g string )(File ,error );TempDir (_gb string )(string ,error );RemoveAll (_de 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 _df .TempDir (pattern )};
// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
type File interface{_f .Reader ;_f .Writer ;_f .Closer ;Name ()string ;};

// TempFile creates new empty file in the storage and returns it.
func TempFile (dir ,pattern string )(File ,error ){return _df .TempFile (dir ,pattern )};
// SetAsStorage changes temporary storage to newStorage.
func SetAsStorage (newStorage storage ){_b =newStorage };var _b storage ;
4 changes: 2 additions & 2 deletions document/convert/convert.go

Large diffs are not rendered by default.

Loading

0 comments on commit d1a3042

Please sign in to comment.