| 1 | /* Script.cpp |
| 2 | * |
| 3 | * Copyright (C) 1997-2005,2009,2011,2015,2016,2020,2024-2026 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "Script.h"cxx . . $ `<file>/sys/Script.h`/ |
| 20 | |
| 21 | Thing_implementcxx . . $ `sys/Thing.h:65:9`! (Script, SimpleString, 0); |
| 22 | Thing_implementcxx . . $ `sys/Thing.h:65:9`! (ScriptSet, SortedSetOfString, 0); |
| 23 | |
| 24 | static autoScriptSetcxx . . $ autoScriptSet# theKnownScriptscxx . . $ theKnownScripts.; |
| 25 | |
| 26 | autoScriptcxx . . $ autoScript# Script_createFromFilecxx . . $ Script_createFromFile(bd133301ef0e84d8). (MelderFilecxx . . $ MelderFile# file) { |
| 27 | autoScriptcxx . . $ autoScript# me = Thing_newcxx . . $ `sys/Thing.h:514:9`! (Script); |
| 28 | mycxx . . $ `melder/melder.h:44:9`! stringcxx . . $ structSimpleString#string. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (MelderFile_peekPathcxx . . $ MelderFile_peekPath(d9f043369fa9b55b). (file)); |
| 29 | return mecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 30 | } |
| 31 | |
| 32 | void Script_rememberDuringThisAppSession_movecxx . . $ Script_rememberDuringThisAppSession_move(76c604abe5acc916). (autoScriptcxx . . $ autoScript# me) { |
| 33 | if (! theKnownScriptscxx . . $ theKnownScripts.) |
| 34 | theKnownScriptscxx . . $ theKnownScripts. =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). ScriptSet_createcxx . . $ ScriptSet_create(a49d6e3a1acbc869). (); |
| 35 | //TRACE |
| 36 | tracecxx . . $ `melder/melder_debug.h:60:10`! (U"Adding script: \"", mycxx . . $ `melder/melder.h:44:9`! string.get(), U"\""); |
| 37 | theKnownScriptscxx . . $ theKnownScripts. ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). addItem_movecxx . . $ CollectionOf#addItem_move(bcc0cff787be24fe). (mecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f)..movecxx . . $ autoSomeThing#move(25acc3554b7d1642).()); |
| 38 | } |
| 39 | |
| 40 | Scriptcxx . . $ Script# Script_findcxx . . $ Script_find(121335aa8b01ec30). (conststring32cxx . . $ conststring32# filePath) { |
| 41 | const integercxx . . $ integer# position = theKnownScriptscxx . . $ theKnownScripts. ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). lookUpcxx . . $ SortedSetOfStringOf#lookUp(c94c67ff4219bf83). (filePath); |
| 42 | Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (position != 0); |
| 43 | return theKnownScriptscxx . . $ theKnownScripts. ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). atcxx . . $ CollectionOf#at. [cxx . . $ ArrayOf#`operator[]`(a7f36fee1ae21897).position]; |
| 44 | } |
| 45 | |
| 46 | /* End of file Script.cpp */ |