Gnm.Value¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
v_any |
r/w |
||
v_array |
r/w |
||
v_bool |
r/w |
||
v_err |
r/w |
||
v_float |
r/w |
||
v_range |
r/w |
||
v_str |
r/w |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gnm.Value¶
- classmethod cmp(ptr_a, ptr_b)¶
-
qsort style comparison function for ascending order
- classmethod cmp_reverse(ptr_a, ptr_b)¶
-
qsort style comparison function for descending order.
- classmethod error_name(err, translated)¶
- Parameters:
err (
Gnm.StdError
) –Gnm.StdError
- Returns:
the name of err, possibly localized.
- Return type:
- classmethod new_array(cols, rows)¶
- classmethod new_array_empty(cols, rows)¶
- classmethod new_bool(b)¶
- classmethod new_cellrange(a, b, eval_col, eval_row)¶
- Parameters:
a (
Gnm.CellRef
) –b (
Gnm.CellRef
) –eval_col (
int
) –eval_row (
int
) –
- Return type:
Create a new range reference.
Attempt to do a sanity check for inverted ranges. NOTE : This is no longer necessary and will be removed. mixed mode references create the possibility of inversion. users of these values need to use the utility routines to evaluate the ranges in their context and normalize then.
- classmethod new_cellrange_parsepos_str(pp, str, flags)¶
- Parameters:
pp (
Gnm.ParsePos
) – if a relative range is specified, then it will be interpreted relative to this position (affects only A1-style relative references).str (
str
) – a range specification (ex: “A1”, “A1:C3”, “Sheet1!A1:C3”, “R1C1”).flags (
Gnm.ExprParseFlags
) –
- Return type:
Parse str using the convention associated with sheet. Returns a (
Gnm.Value
*) of typeGnm.ValueType.CELLRANGE
if the range was successfully parsed orNone
on failure.
- classmethod new_cellrange_r(sheet, r)¶
- classmethod new_cellrange_str(sheet, str)¶
- Parameters:
- Return type:
Parse str using the convention associated with sheet. Returns a (
Gnm.Value
*) of typeGnm.ValueType.CELLRANGE
if the range was successfully parsed orNone
on failure.
- classmethod new_float(f)¶
- classmethod new_from_string(t, str, sf, translated)¶
- Parameters:
t (
Gnm.ValueType
) –str (
str
) –sf (
GOffice.Format
) –translated (
bool
) –
- Return type:
- classmethod new_int(i)¶
- Parameters:
i (
int
) – integer- Returns:
a new integer
GOffice.value
. There is no separate integer type, so this is just an alias forGnm.Value.new_float
.- Return type:
- classmethod new_string(str)¶
- classmethod new_string_str(str)¶
- Parameters:
str (
GOffice.String
) – string to use forGOffice.value
- Returns:
a new string
GOffice.value
.- Return type:
- area_fetch_x_y(x, y, ep)¶
- Parameters:
x (
int
) – columny (
int
) –Gnm.row
ep (
Gnm.EvalPos
) – constGnm.EvalPos
*
- Return type:
An internal routine to get a cell from an array or range. Ensures that elements of CELLRANGE are evaluated
Returns the element if it exists and is non-empty otherwise returns 0
- area_foreach(ep, flags, func, *user_data)¶
- Parameters:
ep (
Gnm.EvalPos
) – constGnm.EvalPos
flags (
Gnm.CellIterFlags
) –Gnm.CellIterFlags
func (
Gnm.ValueIterFunc
) –Gnm.ValueIterFunc
- Returns:
non-
None
on error, or VALUE_TERMINATE if some the handler requested to stop (by returning non-None
).- Return type:
For each existing element in an array or range, invoke the callback routine.
- area_get_height(ep)¶
- Parameters:
ep (
Gnm.EvalPos
) –- Return type:
- area_get_width(ep)¶
- Parameters:
ep (
Gnm.EvalPos
) –- Return type:
- area_get_x_y(x, y, ep)¶
- Parameters:
x (
int
) – columny (
int
) –Gnm.row
ep (
Gnm.EvalPos
) – constGnm.EvalPos
*
- Return type:
An internal routine to get a cell from an array or range. Ensures that elements of CELLRANGE are evaluated
If any problems occur a
None
is returned.
- array_set(col, row, v)¶
-
Sets an element of an array
GOffice.value
.
- coerce_to_number(valid, ep)¶
- Parameters:
valid (
bool
) –ep (
Gnm.EvalPos
) –
- Return type:
If the
GOffice.value
can be used as a number return that number otherwise free it at return an appropriate error
- compare(b, case_sensitive)¶
- Parameters:
- Return type:
- compare_no_cache(b, case_sensitive)¶
- Parameters:
- Return type:
- diff(b)¶
-
IGNORES format.
Returns a non-negative difference between 2 values
- dump()¶
- equal(b)¶
- error_classify()¶
- Return type:
- get_as_gstring(target, conv)¶
- Parameters:
target (
GLib.String
) –GLib.String
conv (
Gnm.Conventions
) –Gnm.Conventions
A simple
GOffice.value
formatter to convert self into a string stored in target according to conv. SeeGnm.format_value_gstring
for something more elaborate that handles formats too.
- get_as_string()¶
- Returns:
a string rendering of self.
- Return type:
Simplistic
GOffice.value
rendering
- get_rangeref()¶
- Returns:
the cell range of a cell range
GOffice.value
.- Return type:
- is_zero()¶
- peek_string()¶
- Returns:
A string representation of the
GOffice.value
. The result will stay valid until either (a) theGOffice.value
is disposed of, or (b) two further calls to this function are made.- Return type:
- release()¶
Free the
GOffice.value
.
- set_fmt(fmt)¶
- Parameters:
fmt (
GOffice.Format
) –
- stringify()¶
- Returns:
A string representation of the
GOffice.value
suitable for use in a Python __repr__ function.- Return type:
- type_of()¶
- Return type: