omdl  v1.0
OpenSCAD Mechanical Design Library
map.scad File Reference

Map data structure and operations. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions and/or Modules

Functions
function map_get_index (m, k)
 Return the index of a map key. More...
 
function map_exists (m, k)
 Test if a key exists. More...
 
function map_get_value (m, k)
 Get the map value associated with a key. More...
 
function map_get_keys (m)
 Get a list of all map keys. More...
 
function map_get_values (m)
 Get a list of all map values. More...
 
function map_get_firstof2_or (m1, m2, k, d)
 Get the the first value associated with an existing key in one of two maps. More...
 
function map_get_size (m)
 Get the number of map entries. More...
 
function map_merge (m1, m2)
 Merge the unique key-value pairs of a second map with those of a first. More...
 
function map_update (m, u, ignore=false)
 Update existing key-value pairs of a map. More...
 
function map_equal (m1, m2, keys=true, values=false, sort=true)
 Compare the keys and/or values of two maps to test for equality. More...
 
function map_from_table (t, keys=0, values=1)
 Create a map from two selected columns of a data table. More...
 
function map_to_table (ml, sort=false)
 Create a table from a list of maps with common keys. More...
 
function map_errors (m)
 Perform basic format checks on a map and return errors. More...
 
module map_check (m, verbose=false)
 Perform basic format checks on a map and output errors to console. More...
 
module map_dump (m, sort=false, number=true, align=true, p=3)
 Dump each map entry to the console. More...
 
module map_write (m, ks, sort=false, number=false, fs="^", thn="idx", index_tags=empty_lst, key_tags=["b"], value_tags=empty_lst)
 Write formatted map entries to the console. More...
 

Variables

Variables
 $map_strict = false
 <boolean> Enforce strict checking for map value references.
 

File Details

Map data structure and operations.

Author
Roy Allen Sutton
Date
2015-2026

This file is part of omdl, an OpenSCAD mechanical design library.

The omdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

The omdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the omdl; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA; or see http://www.gnu.org/licenses/.

Definition in file map.scad.