GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — libfoundation: Add span overloads for array accessors · livecode/livecode@ae2cb83

This repository was archived by the owner on Aug 31, 2021. It is now read-only.

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • libfoundation
    • include
      • foundation-span.h
    • src
      • foundation-array.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎libfoundation/include/foundation-span.h‎

Copy file name to clipboardExpand all lines: libfoundation/include/foundation-span.h
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,23 @@ inline void MCMemoryClearSecure(MCSpan<ElementType> x_span)
216216
x_span.sizeBytes());
217217
}
218218

219+
MC_DLLEXPORT
220+
bool MCArrayStoreValueOnPath(MCArrayRef array,
221+
bool case_sensitive,
222+
MCSpan<MCNameRef> path,
223+
MCValueRef value);
224+
225+
MC_DLLEXPORT
226+
bool MCArrayFetchValueOnPath(MCArrayRef array,
227+
bool case_sensitive,
228+
MCSpan<MCNameRef> path,
229+
MCValueRef& r_value);
230+
231+
MC_DLLEXPORT
232+
bool MCArrayRemoveValueOnPath(MCArrayRef array,
233+
bool case_sensitive,
234+
MCSpan<MCNameRef> path);
235+
219236
MC_DLLEXPORT
220237
hash_t MCHashBytes(MCSpan<const byte_t> bytes);
221238

Collapse file

‎libfoundation/src/foundation-array.cpp‎

Copy file name to clipboardExpand all lines: libfoundation/src/foundation-array.cpp
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ bool MCArrayFetchValueOnPath(MCArrayRef self, bool p_case_sensitive, const MCNam
433433
return MCArrayFetchValueOnPath((MCArrayRef)t_value, p_case_sensitive, p_path + 1, p_path_length - 1, r_value);
434434
}
435435

436+
bool MCArrayFetchValueOnPath(MCArrayRef array,
437+
bool case_sensitive,
438+
const MCSpan<MCNameRef> path,
439+
MCValueRef& value)
440+
{
441+
return MCArrayFetchValueOnPath(array, case_sensitive,
442+
path.data(), path.size(),
443+
value);
444+
}
445+
436446
//////////////////////
437447

438448
MC_DLLEXPORT_DEF
@@ -537,6 +547,16 @@ bool MCArrayStoreValueOnPath(MCArrayRef self, bool p_case_sensitive, const MCNam
537547
return true;
538548
}
539549

550+
bool MCArrayStoreValueOnPath(MCArrayRef array,
551+
bool case_sensitive,
552+
const MCSpan<MCNameRef> path,
553+
MCValueRef value)
554+
{
555+
return MCArrayStoreValueOnPath(array, case_sensitive,
556+
path.data(), path.size(),
557+
value);
558+
}
559+
540560
//////////////////////
541561

542562
MC_DLLEXPORT_DEF
@@ -605,6 +625,14 @@ bool MCArrayRemoveValueOnPath(MCArrayRef self, bool p_case_sensitive, const MCNa
605625
return true;
606626
}
607627

628+
bool MCArrayRemoveValueOnPath(MCArrayRef array,
629+
bool case_sensitive,
630+
MCSpan<MCNameRef> path)
631+
{
632+
return MCArrayRemoveValueOnPath(array, case_sensitive,
633+
path.data(), path.size());
634+
}
635+
608636
////////////////////////////////////////////////////////////////////////////////
609637

610638
MC_DLLEXPORT_DEF

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.