Skip to content

Commit

Permalink
Shortened some methods' name
Browse files Browse the repository at this point in the history
  • Loading branch information
imsys committed Nov 14, 2013
1 parent b9c7a2a commit f488d84
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions LEIAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Dê uma olhada:
Isto é traduzido por isso pelo pré-compilador:

aaFriends := SHash():New()
aaFriends:SetProperty("David", SHash():New())
aaFriends:GetPropertyValue("David"):SetProperty("Account", 187204)
aaFriends:Set("David", SHash():New())
aaFriends:Get("David"):Set("Account", 187204)

Os objetos SHash contêm o vetor SHash que armazena todos os dados, então é muito fácil acessar tudo através de um loop:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Take a look at it working, this:
is translated to this by the precompiler:

aaFriends := SHash():New()
aaFriends:SetProperty("David", SHash():New())
aaFriends:GetPropertyValue("David"):SetProperty("Account", 187204)
aaFriends:Set("David", SHash():New())
aaFriends:Get("David"):Set("Account", 187204)

The SHash object has the aData array that stores all the data, so you can easily access all the data thought a loop:

Expand Down
8 changes: 4 additions & 4 deletions include/aarray.ch
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
*
* is translated to this by the precompiler:
* aaFriends := SHash():New()
* aaFriends:SetProperty("David", SHash():New())
* aaFriends:GetPropertyValue("David"):SetProperty("Account", 187204)
* aaFriends:Set("David", SHash():New())
* aaFriends:Get("David"):Set("Account", 187204)
*
* The SHash object has the aData array that stores all the data, so you
* can easily access all the data thought a loop:
Expand All @@ -102,8 +102,8 @@
#IFNDEF __HARBOUR__
#include "shash.ch"

#xtranslate \[\#<k>\] := <v> => :SetProperty(<k>,<v>)
#xtranslate \[\#<k>\] => :GetPropertyValue(<k>)
#xtranslate \[\#<k>\] := <v> => :Set(<k>,<v>)
#xtranslate \[\#<k>\] => :Get(<k>)
#xtranslate Array(#) => SHash():New()
#ELSE
#xtranslate \[\#<k>\] := <v> => \[<k>\] := <v>
Expand Down
44 changes: 22 additions & 22 deletions lib/SHash.prg
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ CLASS SHASH
METHOD ClassName()
METHOD GetAtProperty( uPropertyKey )
METHOD GetPropertyValue( uPropertyKey , uDefaultValue )
METHOD SetProperty( uPropertyKey , uValue )
METHOD RemoveProperty( uPropertyKey )
METHOD GetAllProperties( )
METHOD GetAt( uPropertyKey )
METHOD Get( uPropertyKey , uDefaultValue )
METHOD Set( uPropertyKey , uValue )
METHOD Remove( uPropertyKey )
METHOD GetAll( )
ENDCLASS
Expand Down Expand Up @@ -78,13 +78,13 @@ METHOD ClassName() CLASS SHASH
Return( Self:cClassName )
/*/
METHOD: GetAtProperty
METHOD: GetAt
Autor: Marinaldo de Jesus
Data: 04/12/2011
Descricao: Obter a Posicao da Propriedade Passada por parametro e de acordo com a Secao
Sintaxe: SHASH():GetAtProperty( uPropertyKey ) -> nATProperty
Sintaxe: SHASH():GetAt( uPropertyKey ) -> nATProperty
/*/
METHOD GetAtProperty( uPropertyKey ) CLASS SHASH
METHOD GetAt( uPropertyKey ) CLASS SHASH
Local nATProperty := 0
Expand All @@ -97,21 +97,21 @@ METHOD GetAtProperty( uPropertyKey ) CLASS SHASH
Return( nATProperty )
/*/
METHOD: GetPropertyValue
METHOD: Get
Autor: Marinaldo de Jesus
Data: 04/12/2011
Descricao: Obter o valor da Propriedade Passada por parametro e de acordo com a Secao
Sintaxe: SHASH():GetPropertyValue( uPropertyKey , uDefaultValue ) -> uPropertyValue
Sintaxe: SHASH():Get( uPropertyKey , uDefaultValue ) -> uPropertyValue
/*/
METHOD GetPropertyValue( uPropertyKey , uDefaultValue ) CLASS SHASH
METHOD Get( uPropertyKey , uDefaultValue ) CLASS SHASH
Local uPropertyValue := "@__PROPERTY_NOT_FOUND__@"
Local nProperty
BEGIN SEQUENCE
nProperty := Self:GetAtProperty( @uPropertyKey )
nProperty := Self:GetAt( @uPropertyKey )
IF ( nProperty == 0 )
BREAK
EndIF
Expand All @@ -135,17 +135,17 @@ Return( uPropertyValue )
Autor: Marinaldo de Jesus
Data: 04/12/2011
Descricao: Adiciona ou Edita uma propriedade
Sintaxe: SHASH():SetProperty( uPropertyKey , uValue ) -> lSuccess
Sintaxe: SHASH():Set( uPropertyKey , uValue ) -> lSuccess
/*/
METHOD SetProperty( uPropertyKey , uValue ) CLASS SHASH
METHOD Set( uPropertyKey , uValue ) CLASS SHASH
Local lSuccess := .F.
Local nProperty
BEGIN SEQUENCE
nProperty := Self:GetAtProperty( @uPropertyKey )
nProperty := Self:GetAt( @uPropertyKey )
IF ( nProperty == 0 )
aAdd( Self:aData , Array( SPROPERTY_ELEMENTS ) )
Expand All @@ -162,21 +162,21 @@ METHOD SetProperty( uPropertyKey , uValue ) CLASS SHASH
Return( lSuccess )
/*/
METHOD: RemoveProperty
METHOD: Remove
Autor: Marinaldo de Jesus
Data: 04/12/2011
Descricao: Remover Determinada Propriedade
Sintaxe: SHASH():RemoveProperty( uPropertyKey ) -> lSuccess
Sintaxe: SHASH():Remove( uPropertyKey ) -> lSuccess
/*/
METHOD RemoveProperty( uPropertyKey ) CLASS SHASH
METHOD Remove( uPropertyKey ) CLASS SHASH
Local lSuccess := .F.
Local nProperty
BEGIN SEQUENCE
nProperty := Self:GetAtProperty( @uPropertyKey )
nProperty := Self:GetAt( @uPropertyKey )
IF ( nProperty == 0 )
BREAK
EndIF
Expand All @@ -191,13 +191,13 @@ METHOD RemoveProperty( uPropertyKey ) CLASS SHASH
Return( lSuccess )
/*/
METHOD: GetAllProperties
METHOD: GetAll
Autor: Marinaldo de Jesus
Data: 04/12/2011
Descricao: Retornar todas as propriedades
Sintaxe: SHASH():GetAllProperties( ) -> aAllProperties
Sintaxe: SHASH():GetAll( ) -> aAllProperties
/*/
METHOD GetAllProperties() CLASS SHASH
METHOD GetAll() CLASS SHASH
Return( Self:aData )

0 comments on commit f488d84

Please sign in to comment.