Dataset Viewer
Auto-converted to Parquet
commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
e466f86a763f89a26274cf01cb6bbe79b251c50c
ZUSR_LISP_REPL.abap
ZUSR_LISP_REPL.abap
*&---------------------------------------------------------------------* *& Report ZUSR_LISP_REPL *& https://github.com/mydoghasworms/abap-lisp *& Simple REPL for Lisp Interpreter written in ABAP *& Martin Ceronio, June 2015 *& [email protected] *&---------------------------------------------------------------------* report zusr_lisp_repl line-size 999. include zlib_lisp. data: lr_int type ref to lcl_lisp_interpreter. "The Lisp interpreter parameters: input type string lower case. parameters: output type string lower case. at selection-screen output. * Make result field output-only loop at screen. if screen-name = 'OUTPUT'. screen-input = 0. modify screen. endif. endloop. at selection-screen. * Initialize interpreter if not done yet if lr_int is not bound. create object lr_int. endif. * Evaluate given code output = lr_int->eval_source( input ). clear input. load-of-program. * Hitting execute gets us back to this event and initializes the interpreter, * so we preferably want to avoid that happening inadvertently: perform insert_into_excl(rsdbrunt) using: 'ONLI', 'SPOS', 'PRIN', 'SJOB'.
*&---------------------------------------------------------------------* *& Report ZUSR_LISP_REPL *& https://github.com/mydoghasworms/abap-lisp *& Simple REPL for Lisp Interpreter written in ABAP *& Martin Ceronio, June 2015 *& [email protected] *&---------------------------------------------------------------------* report zusr_lisp_repl line-size 999. include zlib_lisp. data: lr_int type ref to lcl_lisp_interpreter. "The Lisp interpreter data: rt_begin type i. data: rt_end type i. parameters: input type string lower case. parameters: output type string lower case. parameters: runtime type string lower case. at selection-screen output. * Make result field output-only loop at screen. if screen-name = 'OUTPUT' or screen-name = 'RUNTIME'. screen-input = 0. if screen-name = 'RUNTIME'. screen-display_3d = 0. endif. modify screen. endif. endloop. at selection-screen. * Initialize interpreter if not done yet if lr_int is not bound. create object lr_int. endif. * Evaluate given code get RUN TIME FIELD rt_begin. output = lr_int->eval_source( input ). get RUN TIME FIELD rt_end. clear input. runtime = |{ rt_end - rt_begin } microseconds|. load-of-program. * Hitting execute gets us back to this event and initializes the interpreter, * so we preferably want to avoid that happening inadvertently: perform insert_into_excl(rsdbrunt) using: 'ONLI', 'SPOS', 'PRIN', 'SJOB'.
Add runtime measurement to REPL
Add runtime measurement to REPL
ABAP
mit
mydoghasworms/abap-lisp,mydoghasworms/abap-lisp,mydoghasworms/abap-lisp
e7cbdfab19d615b146da95f6fbabc3520795fb4f
test/flash_test.as
test/flash_test.as
package { import stdio.Sprite [SWF(width=0, height=0)] public class flash_test extends Sprite { public function main(): void { test_body() } } }
package { import stdio.Sprite [SWF(width=100, height=100)] public class flash_test extends Sprite { public function flash_test(): void { graphics.beginFill(0xff0000) graphics.drawRect(10, 10, 80, 80) graphics.endFill() } public function main(): void { graphics.beginFill(0x0000ff) graphics.drawRect(30, 30, 40, 40) graphics.endFill() test_body() } } }
Add colors to Flash test to ease debugging.
Add colors to Flash test to ease debugging.
ActionScript
mit
dbrock/stdio.as,dbrock/stdio.as,dbrock/stdio.as
250ef712d3bba79191d5ae7f4612d391c78f52f8
as3/smartform/src/com/rpath/raf/views/CompoundInputItem.as
as3/smartform/src/com/rpath/raf/views/CompoundInputItem.as
/* # # Copyright (c) 2009 rPath, Inc. # # This program is distributed under the terms of the MIT License as found # in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licenses/mit-license.php. # # This program 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 MIT License for full details. */ package com.rpath.raf.views { import mx.core.UIComponent; import mx.events.ValidationResultEvent; import spark.components.Group; public class CompoundInputItem extends Group { public function CompoundInputItem() { super(); // force height computation minHeight = 0; } [Bindable] public var inputFields:Array; public override function validationResultHandler(event:ValidationResultEvent):void { // let our specific input controls mark themselves appropriately for each (var elem:UIComponent in inputFields) { elem.validationResultHandler(event); } // propagate events beyond ourselves super.validationResultHandler(event); } } }
/* # # Copyright (c) 2009 rPath, Inc. # # This program is distributed under the terms of the MIT License as found # in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/licenses/mit-license.php. # # This program 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 MIT License for full details. */ package com.rpath.raf.views { import mx.core.UIComponent; import mx.events.ValidationResultEvent; import spark.components.Group; public class CompoundInputItem extends Group { public function CompoundInputItem() { super(); // force height computation minHeight = 0; } [Bindable] public var inputFields:Array; public override function validationResultHandler(event:ValidationResultEvent):void { // let our specific input controls mark themselves appropriately for each (var elem:UIComponent in inputFields) { if (elem) elem.validationResultHandler(event); } // propagate events beyond ourselves super.validationResultHandler(event); } } }
Handle null in validation elem iteration
Handle null in validation elem iteration
ActionScript
apache-2.0
sassoftware/smartform
282e0c5177e4bcf16e8594d9d97d97b2d63dd94c
ImpetusSound.as
ImpetusSound.as
package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; public class ImpetusSound { private var url:String; private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.url = url; this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; } } }
package io.github.jwhile.impetus { import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; public class ImpetusSound { private var sound:Sound; private var channels:Vector.<SoundChannel>; public function ImpetusSound(url:String):void { this.sound = new Sound(); this.channels = new Vector.<SoundChannel>; this.sound.load(new URLRequest(url)); } } }
Load sound directly on constructor
Load sound directly on constructor
ActionScript
mit
Julow/Impetus
249ac6912541cdd6eff1d6ec04f86a1de1f6e597
FlexUnit4Test/src/org/flexunit/experimental/theories/internals/cases/ParameterizedAssertionErrorCase.as
FlexUnit4Test/src/org/flexunit/experimental/theories/internals/cases/ParameterizedAssertionErrorCase.as
package org.flexunit.experimental.theories.internals.cases { import org.flexunit.Assert; import org.flexunit.experimental.theories.internals.ParameterizedAssertionError; public class ParameterizedAssertionErrorCase { //TODO: Ensure that these tests and this test case are being implemented correctly. //It is currently impossible to test the stringValueOf function. [Test(description="Ensure that the ParameterizedAssertionError constructor is correctly assigning parameter values")] public function constructorTest():void { var targetException:Error = new Error(); var methodName:String = "methodName"; var params:Array = new Array("valueOne", "valueTwo"); var parameterizedAssertionError:ParameterizedAssertionError = new ParameterizedAssertionError(targetException, methodName, "valueOne", "valueTwo"); var message:String = methodName + " " + params.join( ", " ); Assert.assertEquals( message, parameterizedAssertionError.message); Assert.assertEquals( targetException, parameterizedAssertionError.targetException ); } [Test(description="Ensure that the join function is correctly joining the delimiter to the other parameters")] public function joinTest():void { var delimiter:String = ", "; var params:Array = new Array("valueOne", "valueTwo", "valueThree"); var message:String = params.join( delimiter ); Assert.assertEquals( message, ParameterizedAssertionError.join(delimiter, "valueOne", "valueTwo", "valueThree") ); } } }
package org.flexunit.experimental.theories.internals.cases { import org.flexunit.Assert; import org.flexunit.experimental.theories.internals.ParameterizedAssertionError; public class ParameterizedAssertionErrorCase { //TODO: Ensure that these tests and this test case are being implemented correctly. //It is currently impossible to test the stringValueOf function. [Ignore("Currently Ignoring Test as this functionality is under investigation due to Max stack overflow issue")] [Test(description="Ensure that the ParameterizedAssertionError constructor is correctly assigning parameter values")] public function constructorTest():void { var targetException:Error = new Error(); var methodName:String = "methodName"; var params:Array = new Array("valueOne", "valueTwo"); var parameterizedAssertionError:ParameterizedAssertionError = new ParameterizedAssertionError(targetException, methodName, "valueOne", "valueTwo"); var message:String = methodName + " " + params.join( ", " ); Assert.assertEquals( message, parameterizedAssertionError.message); Assert.assertEquals( targetException, parameterizedAssertionError.targetException ); } [Test(description="Ensure that the join function is correctly joining the delimiter to the other parameters")] public function joinTest():void { var delimiter:String = ", "; var params:Array = new Array("valueOne", "valueTwo", "valueThree"); var message:String = params.join( delimiter ); Assert.assertEquals( message, ParameterizedAssertionError.join(delimiter, "valueOne", "valueTwo", "valueThree") ); } } }
Set test to ignore while stack trace is still under investigation
Set test to ignore while stack trace is still under investigation
ActionScript
apache-2.0
SlavaRa/flex-flexunit,SlavaRa/flex-flexunit,SlavaRa/flex-flexunit,apache/flex-flexunit,apache/flex-flexunit,apache/flex-flexunit,SlavaRa/flex-flexunit,apache/flex-flexunit
5a0a30838ae3515302f39b2f3ccb3ea98aba5101
braineditor/Brain.as
braineditor/Brain.as
import Drawable; import Lobe; import Core; class Brain{ static var brain = new Array(); var mSelectionManager:SelectionManager; static function makenewlobe(){ var newmov=(new Lobe(_root,_root.getNextHighestDepth())); var topleft = new Point(100,40); var botright = new Point(200,140); newmov.commitBox(topleft, botright, 0); var keyListener = {}; keyListener.onKeyDown = function() { var k = Key.getCode(); if(k == Key.DELETEKEY){ Brain.makenewlobe(); } }; } function Brain (root_mc:MovieClip) { mSelectionManager = new SelectionManager(root_mc); } }
import Drawable; import Lobe; import Core; class Brain{ static var brain = new Array(); var mSelectionManager:SelectionManager; static function makenewlobe(){ var newmov=(new Lobe(_root,_root.getNextHighestDepth())); var topleft = new Point(100,40); var botright = new Point(200,140); newmov.commitBox(topleft, botright, 0); } function Brain (root_mc:MovieClip) { mSelectionManager = new SelectionManager(root_mc); var keyListener = {}; keyListener.onKeyDown = function() { var k = Key.getCode(); if(k == Key.DELETEKEY){ Brain.makenewlobe(); } }; Key.addListener( keyListener ); } }
Delete is now a non-core function
Delete is now a non-core function git-svn-id: f772d44cbf86d9968f12179c1556189f5afcea6e@658 e0ac87d7-b42b-0410-9034-8248a05cb448
ActionScript
bsd-3-clause
elysia/elysia,elysia/elysia,elysia/elysia
5e97a04402e9e854dd68c6aceb088ed46f0faa6f
src/as/com/threerings/crowd/data/ManagerCaller.as
src/as/com/threerings/crowd/data/ManagerCaller.as
// // $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library 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. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package com.threerings.crowd.data { public class ManagerCaller { public function ManagerCaller (plobj :PlaceObject) { _plobj = plobj; } /** * Called to call a method on the manager. */ public function invoke (method :String, args :Array = null) :void { _plobj.postMessage(method, args); } /** The place object we're thingy-ing for. */ protected var _plobj :PlaceObject; } }
// // $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/narya/ // // This library 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. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package com.threerings.crowd.data { public class ManagerCaller { public function ManagerCaller (plobj :PlaceObject) { _plobj = plobj; } /** * Called to call a method on the manager. */ public function invoke (method :String, ... args) :void { _plobj.postMessage(method, args); } /** The place object we're thingy-ing for. */ protected var _plobj :PlaceObject; } }
Change this instance back. Varargs are still a nightmare and should generally be avoided, but nobody's going to override this method and we're always calling a regular method on the server, not a varargs method.
Change this instance back. Varargs are still a nightmare and should generally be avoided, but nobody's going to override this method and we're always calling a regular method on the server, not a varargs method. git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4622 542714f4-19e9-0310-aa3c-eee0fc999fb1
ActionScript
lgpl-2.1
threerings/narya,threerings/narya,threerings/narya,threerings/narya,threerings/narya
f475b23fb4845ee1bd34bf8d88581f16c96470eb
src/as/com/threerings/flex/LabeledSlider.as
src/as/com/threerings/flex/LabeledSlider.as
package com.threerings.flex { import mx.containers.HBox; import mx.controls.Label; import mx.controls.sliderClasses.Slider; import mx.events.SliderEvent; /** * A simple component that displays a label to the left of a slider. */ public class LabeledSlider extends HBox { /** The slider, all public and accessable. Don't fuck it up! */ public var slider :Slider; /** * Create a LabeledSlider holding the specified slider. */ public function LabeledSlider (slider :Slider) { _label = new Label(); _label.text = String(slider.value); addChild(_label); this.slider = slider; slider.showDataTip = false; // because we do it... addChild(slider); slider.addEventListener(SliderEvent.CHANGE, handleSliderChange, false, 0, true); } protected function handleSliderChange (event :SliderEvent) :void { _label.text = String(event.value); } protected var _label :Label; } }
package com.threerings.flex { import mx.containers.HBox; import mx.controls.Label; import mx.controls.sliderClasses.Slider; import mx.events.SliderEvent; /** * A simple component that displays a label to the left of a slider. */ public class LabeledSlider extends HBox { /** The actual slider. */ public var slider :Slider; /** * Create a LabeledSlider holding the specified slider. */ public function LabeledSlider (slider :Slider) { _label = new Label(); _label.text = String(slider.value); addChild(_label); this.slider = slider; slider.showDataTip = false; // because we do it... addChild(slider); slider.addEventListener(SliderEvent.CHANGE, handleSliderChange, false, 0, true); } protected function handleSliderChange (event :SliderEvent) :void { _label.text = String(event.value); } protected var _label :Label; } }
Clean up my comment, this is in a public API (and my comment wasn't helpful).
Clean up my comment, this is in a public API (and my comment wasn't helpful). git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@166 ed5b42cb-e716-0410-a449-f6a68f950b19
ActionScript
lgpl-2.1
threerings/nenya,threerings/nenya
09607ce618998f098daf204f4dfb54f3a79408c3
HLSPlugin/src/org/denivip/osmf/utils/Utils.as
HLSPlugin/src/org/denivip/osmf/utils/Utils.as
package org.denivip.osmf.utils { import org.osmf.utils.URL; public class Utils { public static function createFullUrl(rootUrl:String, url:String):String{ if(url.search(/(ftp|file|https?):\/\/\/?/) == 0) return url; // other manipulations :) if(url.charAt(0) == '/'){ return URL.getRootUrl(rootUrl) + url; } if(rootUrl.lastIndexOf('/') != rootUrl.length) rootUrl += '/'; return rootUrl + url; } } }
package org.denivip.osmf.utils { import org.osmf.utils.URL; public class Utils { public static function createFullUrl(rootUrl:String, url:String):String { if(url.search(/(ftp|file|https?):\/\/\/?/) == 0) return url; // other manipulations :) if(url.charAt(0) == '/'){ return URL.getRootUrl(rootUrl) + url; } if(rootUrl.lastIndexOf('/') != rootUrl.length - 1) rootUrl += '/'; return rootUrl + url; } } }
Fix issue where check for final slash was comparing zero-based index with length
Fix issue where check for final slash was comparing zero-based index with length
ActionScript
isc
mruse/osmf-hls-plugin,denivip/osmf-hls-plugin,mruse/osmf-hls-plugin,denivip/osmf-hls-plugin
616f18546c777108dd2b7b39d2e4f524bbfd42c1
src/as/com/threerings/util/NetUtil.as
src/as/com/threerings/util/NetUtil.as
package com.threerings.util { import flash.net.URLRequest; //import flash.net.navigateToURL; // function import public class NetUtil { /** * Convenience method to load a web page in the browser window without * having to worry about SecurityErrors in various conditions. */ public static function navigateToURL ( url :String, preferSameWindowOrTab :Boolean = true) :void { var ureq :URLRequest = new URLRequest(url); if (preferSameWindowOrTab) { try { flash.net.navigateToURL(ureq, "_self"); return; } catch (err :SecurityError) { // ignore; fall back to using a blank window, below... } } // open in a blank window try { flash.net.navigateToURL(ureq); } catch (err :SecurityError) { Log.getLog(NetUtil).warning( "Unable to navigate to URL [e=" + err + "]."); } } } }
package com.threerings.util { import flash.net.URLRequest; //import flash.net.navigateToURL; // function import public class NetUtil { /** * Convenience method to load a web page in the browser window without * having to worry about SecurityErrors in various conditions. * * @return true if the url was unable to be loaded. */ public static function navigateToURL ( url :String, preferSameWindowOrTab :Boolean = true) :Boolean { var ureq :URLRequest = new URLRequest(url); if (preferSameWindowOrTab) { try { flash.net.navigateToURL(ureq, "_self"); return true; } catch (err :SecurityError) { // ignore; fall back to using a blank window, below... } } // open in a blank window try { flash.net.navigateToURL(ureq); return true; } catch (err :SecurityError) { Log.getLog(NetUtil).warning( "Unable to navigate to URL [e=" + err + "]."); } return false; // failure! } } }
Return true if we succeeded.
Return true if we succeeded. git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4462 542714f4-19e9-0310-aa3c-eee0fc999fb1
ActionScript
lgpl-2.1
threerings/narya,threerings/narya,threerings/narya,threerings/narya,threerings/narya
a7d413fa70a55a8050ba5ca6c98938c2d5533c0b
src/laml/display/Skin.as
src/laml/display/Skin.as
package laml.display { import flash.display.DisplayObject; import flash.display.Sprite; public class Skin extends Sprite implements ISkin { public function getBitmapByName(alias:String):DisplayObject { if(hasOwnProperty(alias)) { return new this[alias]() as DisplayObject; } return null; } } }
package laml.display { import flash.display.DisplayObject; import flash.display.Sprite; import mx.core.BitmapAsset; import mx.core.FontAsset; import mx.core.IFlexAsset; import mx.core.IFlexDisplayObject; import mx.core.SpriteAsset; public class Skin extends Sprite implements ISkin { private var bitmapAsset:BitmapAsset; private var fontAsset:FontAsset; private var iFlexAsset:IFlexAsset; private var iFlexDisplayObject:IFlexDisplayObject; private var spriteAsset:SpriteAsset; public function getBitmapByName(alias:String):DisplayObject { if(hasOwnProperty(alias)) { return new this[alias]() as DisplayObject; } return null; } } }
Put MX dependencies in skin
Put MX dependencies in skin git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4281 3e7533ad-8678-4d30-8e38-00a379d3f0d0
ActionScript
mit
lukebayes/laml
0f4d55bed5e68604f4dcc42305136227aa075e3c
flexclient/dag/Components/Association.as
flexclient/dag/Components/Association.as
package Components { [Bindable] public class Association { public var associatedNode:String; public var associatedLink:String; public var operatorIndex:int; public function Association(associatedNode:String,associatedLink:String,operatorIndex:int) { this.associatedLink = associatedLink; this.associatedNode = associatedNode; this.operatorIndex = operatorIndex; } } }
package Components { [Bindable] public class Association { public var associatedNode:String; public var associatedLink:String; public var operatorIndex:int; public var order:int=0; public function Association(associatedNode:String,associatedLink:String,operatorIndex:int,order:int) { this.associatedLink = associatedLink; this.associatedNode = associatedNode; this.operatorIndex = operatorIndex; this.order=order; } } }
Order vairable added todecide order of association
Order vairable added todecide order of association SVN-Revision: 9306
ActionScript
bsd-3-clause
asamgir/openspecimen,asamgir/openspecimen,krishagni/openspecimen,krishagni/openspecimen,asamgir/openspecimen,krishagni/openspecimen
5230cd695aca000a21c51a148333efc1b83d77bf
tests/org/osflash/signals/AllTestsRunner.as
tests/org/osflash/signals/AllTestsRunner.as
package org.osflash.signals { import asunit4.ui.MinimalRunnerUI; import org.osflash.signals.AllTests; public class AllTestsRunner extends MinimalRunnerUI { public function AllTestsRunner() { run(org.osflash.signals.AllTests); } } }
package org.osflash.signals { import asunit4.ui.MinimalRunnerUI; import org.osflash.signals.AllTests; [SWF(width='1000', height='800', backgroundColor='#333333', frameRate='31')] public class AllTestsRunner extends MinimalRunnerUI { public function AllTestsRunner() { run(org.osflash.signals.AllTests); } } }
Put [SWF] tag in test runner app.
Put [SWF] tag in test runner app.
ActionScript
mit
ifuller1/Signals
7b21f4727df5d0d411788bc1db1c73e4606727b0
src/com/axis/rtspclient/NALU.as
src/com/axis/rtspclient/NALU.as
package com.axis.rtspclient { import flash.events.Event; import flash.external.ExternalInterface; import flash.utils.ByteArray; public class NALU extends Event { public static const NEW_NALU:String = "NEW_NALU"; private var data:ByteArray; public var ntype:uint; public var nri:uint; public var timestamp:uint; public var bodySize:uint; public function NALU(ntype:uint, nri:uint, data:ByteArray, timestamp:uint) { super(NEW_NALU); this.data = data; this.ntype = ntype; this.nri = nri; this.timestamp = timestamp; this.bodySize = data.bytesAvailable; } public function appendData(idata:ByteArray):void { ByteArrayUtils.appendByteArray(data, idata); this.bodySize = data.bytesAvailable; } public function isIDR():Boolean { return (5 === ntype); } public function writeSize():uint { return 2 + 2 + 1 + data.bytesAvailable; } public function writeStream(output:ByteArray):void { output.writeUnsignedInt(data.bytesAvailable + 1); // NALU length + header output.writeByte((0x0 & 0x80) | (nri & 0x60) | (ntype & 0x1F)); // NAL header output.writeBytes(data, data.position); } } }
package com.axis.rtspclient { import flash.events.Event; import flash.external.ExternalInterface; import flash.utils.ByteArray; public class NALU extends Event { public static const NEW_NALU:String = "NEW_NALU"; private var data:ByteArray; public var ntype:uint; public var nri:uint; public var timestamp:uint; public var bodySize:uint; public function NALU(ntype:uint, nri:uint, data:ByteArray, timestamp:uint) { super(NEW_NALU); this.data = data; this.ntype = ntype; this.nri = nri; this.timestamp = timestamp; this.bodySize = data.bytesAvailable; } public function appendData(idata:ByteArray):void { ByteArrayUtils.appendByteArray(data, idata); this.bodySize = data.bytesAvailable; } public function isIDR():Boolean { return (5 === ntype); } public function writeSize():uint { return 2 + 2 + 1 + data.bytesAvailable; } public function writeStream(output:ByteArray):void { output.writeUnsignedInt(data.bytesAvailable + 1); // NALU length + header output.writeByte((0x0 & 0x80) | (nri & 0x60) | (ntype & 0x1F)); // NAL header output.writeBytes(data, data.position); } public function getPayload():ByteArray { var payload:ByteArray = new ByteArray(); data.position -= 1; data.readBytes(payload, 0, data.bytesAvailable); return payload; } } }
Implement getPayload() method to extract SPS/PPS bytes
Implement getPayload() method to extract SPS/PPS bytes
ActionScript
bsd-3-clause
AxisCommunications/locomote-video-player,gaetancollaud/locomote-video-player
dfa67685ba284fc652661591d78c5cda846680df
test-src/test_readline_flash.as
test-src/test_readline_flash.as
package { import stdio.flash.Sprite import stdio.process import stdio.Interactive [SWF(width=0, height=0)] public class test_readline_flash extends Sprite implements Interactive { public function main(): void { process.prompt = "What’s your name? " process.gets(function (name: String): void { process.puts("Hello, " + name + "!") process.prompt = "Favorite color? " process.gets(function (color: String): void { process.puts("I like " + color + " too!") process.exit() }) }) } } }
package { import stdio.colorize import stdio.flash.Sprite import stdio.process import stdio.Interactive [SWF(width=0, height=0)] public class test_readline_flash extends Sprite implements Interactive { public function main(): void { process.prompt = "What’s your name? " process.gets(function (name: String): void { process.puts("Hello, " + name + "!") process.prompt = "What’s your favorite color? " process.gets(function (color: String): void { color = color.toLowerCase() process.puts( "I like " + colorize( "%{bold}%{" + color + "}" + color + "%{none}" ) + " too!" ) process.exit() }) }) } } }
Use `colorize` in readline test.
Use `colorize` in readline test.
ActionScript
mit
dbrock/stdio.as,dbrock/stdio.as,dbrock/stdio.as
9eab92b2206ba25d79229f744fe95824c95ce64a
collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/i18n/Message.as
collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/i18n/Message.as
package org.openforis.collect.i18n { import mx.resources.ResourceManager; /** * @author Mino Togna * */ public class Message { public function Message() { } public static function get(resource:String, parameters:Array=null, bundle:String="messages"):String { return ResourceManager.getInstance().getString(bundle, resource, parameters); } } }
package org.openforis.collect.i18n { import mx.resources.ResourceManager; /** * @author Mino Togna * @author S. Ricci * */ public class Message { public function Message() { } public static function get(resource:String, parameters:Array=null, bundle:String="messages"):String { var message:String = ResourceManager.getInstance().getString(bundle, resource, parameters); if(message != null) { return message; } else { return resource; } } } }
Return resource name instead of null if not found
Return resource name instead of null if not found
ActionScript
mit
openforis/collect,openforis/collect,openforis/collect,openforis/collect
630666dc175d469d0b6e9dabb880aeffc2f2d5ee
dolly-framework/src/test/resources/dolly/data/PropertyLevelCopyableClass.as
dolly-framework/src/test/resources/dolly/data/PropertyLevelCopyableClass.as
package dolly.data { public class PropertyLevelCopyableClass { [Copyable] public static var staticProperty1:String = "Value of first-level static property 1."; public static var staticProperty2:String = "Value of first-level static property 2."; [Cloneable] private var _writableField1:String = "Value of first-level writable field."; [Cloneable] public var property1:String = "Value of first-level public property 1."; public var property2:String = "Value of first-level public property 2."; public function PropertyLevelCopyableClass() { } [Copyable] public function get writableField1():String { return _writableField1; } public function set writableField1(value:String):void { _writableField1 = value; } [Copyable] public function get readOnlyField1():String { return "Value of first-level read-only field."; } } }
package dolly.data { public class PropertyLevelCopyableClass { [Copyable] public static var staticProperty1:String = "Value of first-level static property 1."; public static var staticProperty2:String = "Value of first-level static property 2."; [Copyable] private var _writableField1:String = "Value of first-level writable field."; [Copyable] public var property1:String = "Value of first-level public property 1."; public var property2:String = "Value of first-level public property 2."; public function PropertyLevelCopyableClass() { } [Copyable] public function get writableField1():String { return _writableField1; } public function set writableField1(value:String):void { _writableField1 = value; } [Copyable] public function get readOnlyField1():String { return "Value of first-level read-only field."; } } }
Fix stupid mistake with metadata names.
Fix stupid mistake with metadata names.
ActionScript
mit
Yarovoy/dolly
c6baab42b3de3e9651be5a9ef0fa0a59135c77e1
test/unit/Suite.as
test/unit/Suite.as
package { import asunit.framework.TestSuite; public class Suite extends TestSuite { public function Suite() { super(); addTest(new PlayerTest("testPass")); } } }
package { import asunit.framework.TestSuite; public class Suite extends TestSuite { public function Suite() { super(); addTest(new PlayerTest("testPass")); addTest(new UriTest("test_isSafe")); } } }
Add URI tests to the asunit test suite
Add URI tests to the asunit test suite
ActionScript
mit
cameronhunter/divine-player-swf
66f76eb954dd7fb4a0d9b92c099a53aa6ef6519a
ImpetusSound.as
ImpetusSound.as
package { import flash.media.Sound; import flash.net.URLRequest; public class ImpetusSound { private var sound:Sound; private var channels:Vector.<ImpetusChannel>; public function ImpetusSound(url:String):void { this.sound = new Sound(); this.channels = new Vector.<ImpetusChannel>; this.sound.load(new URLRequest(url)); } public function playNew():ImpetusChannel { var c:ImpetusChannel = new ImpetusChannel(this.sound.play(0)); channels.push(c); return c; } public function stopAll():void { var len:int = this.channels.length; for(var i:int; i < len; i++) { this.channels[i].stop(); } } } }
package { import flash.media.Sound; import flash.net.URLRequest; public class ImpetusSound { private var url:String; private var sound:Sound; private var channels:Vector.<ImpetusChannel>; public function ImpetusSound(url:String):void { this.url = url; this.sound = new Sound(); this.channels = new Vector.<ImpetusChannel>; this.sound.load(new URLRequest(url)); } public function get getUrl():String { return this.url } public function playNew():ImpetusChannel { var c:ImpetusChannel = new ImpetusChannel(this.sound.play(0)); channels.push(c); return c; } public function stopAll():void { var len:int = this.channels.length; for(var i:int; i < len; i++) { this.channels[i].stop(); } } } }
Store url & add getUrl() getter
Store url & add getUrl() getter
ActionScript
mit
Julow/Impetus
c20791327b41070b5de2d34c49be14eb766be31d
src/avm2/tests/regress/correctness/callsuper7.as
src/avm2/tests/regress/correctness/callsuper7.as
package { class ClassA { public function ClassA() { trace('A'); } protected function foo() : void { trace('a'); } protected function bar() : void { trace('b'); } } class ClassC extends ClassA { public function ClassC() { trace('> C'); super(); foo(); bar(); trace('< C'); } override protected function bar() : void { super.bar(); trace('override b'); } } class ClassE extends ClassC { public function ClassE() { trace('> E'); super(); foo(); bar(); trace('< E'); } override protected function bar() : void { super.bar(); trace('override b again'); } } // var c = new ClassC(); // var e = new ClassE(); class X { protected var } trace("--"); }
package { class ClassA { public function ClassA() { trace('A'); } protected function foo() : void { trace('a'); } protected function bar() : void { trace('b'); } } class ClassC extends ClassA { public function ClassC() { trace('> C'); super(); foo(); bar(); trace('< C'); } override protected function bar() : void { super.bar(); trace('override b'); } } class ClassE extends ClassC { public function ClassE() { trace('> E'); super(); foo(); bar(); trace('< E'); } override protected function bar() : void { super.bar(); trace('override b again'); } } trace("--"); }
Fix call super test case.
Fix call super test case.
ActionScript
apache-2.0
mbebenita/shumway,mbebenita/shumway,tschneidereit/shumway,mozilla/shumway,mbebenita/shumway,mozilla/shumway,tschneidereit/shumway,yurydelendik/shumway,mozilla/shumway,mozilla/shumway,mozilla/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,yurydelendik/shumway,yurydelendik/shumway,tschneidereit/shumway,yurydelendik/shumway,tschneidereit/shumway,mozilla/shumway,yurydelendik/shumway,tschneidereit/shumway,mbebenita/shumway,mbebenita/shumway,mozilla/shumway,yurydelendik/shumway,mozilla/shumway,tschneidereit/shumway,mbebenita/shumway
6f3e6e0cf6bd1178eb5aa12ccb1e9e179f9c420b
src/flails/mxml/ResourcefulServiceInvoker.as
src/flails/mxml/ResourcefulServiceInvoker.as
package flails.mxml { import com.asfusion.mate.actions.AbstractServiceInvoker; import com.asfusion.mate.actionLists.IScope; import com.asfusion.mate.actions.IAction; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import flails.request.RequestPipe; import flails.resource.Resources; import flails.resource.Resource; public class ResourcefulServiceInvoker extends AbstractServiceInvoker implements IAction { public var resource:Resource; public var data:Array; public var type:String; public var id:String; public var parent:Object; [Bindable] public var result:Object; public function ResourcefulServiceInvoker() { currentInstance = this; } override protected function prepare(scope:IScope):void { super.prepare(scope); } override protected function run(scope:IScope):void { trace ("Using resource " + resource); var rp:RequestPipe = resource.newRequestPipe(); innerHandlersDispatcher = rp; if (resultHandlers && resultHandlers.length > 0) { createInnerHandlers(scope, ResultEvent.RESULT, resultHandlers); } if (faultHandlers && faultHandlers.length > 0) { createInnerHandlers(scope, FaultEvent.FAULT, faultHandlers); } trace("calling " + type + "()"); rp[type].apply(rp, data); } } }
package flails.mxml { import com.asfusion.mate.actions.AbstractServiceInvoker; import com.asfusion.mate.actionLists.IScope; import com.asfusion.mate.actions.IAction; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import flails.request.RequestPipe; import flails.resource.Resources; import flails.resource.Resource; public class ResourcefulServiceInvoker extends AbstractServiceInvoker implements IAction { private var _data:Array; public var resource:Resource; public var type:String; public var id:String; public var parent:Object; [Bindable] public var result:Object; public function set data(args:Object):void { trace("setting data"); if (args is Array) _data = args as Array; else _data = [args]; } override protected function prepare(scope:IScope):void { currentInstance = this; super.prepare(scope); } override protected function run(scope:IScope):void { trace ("Using resource " + resource); var rp:RequestPipe = resource.newRequestPipe(); innerHandlersDispatcher = rp; if (resultHandlers && resultHandlers.length > 0) { createInnerHandlers(scope, ResultEvent.RESULT, resultHandlers); } if (faultHandlers && faultHandlers.length > 0) { createInnerHandlers(scope, FaultEvent.FAULT, faultHandlers); } trace("calling " + type + "() with " + _data); rp[type].apply(rp, _data); } } }
Set currentInstance on prepare, not on instantiation time.
Set currentInstance on prepare, not on instantiation time.
ActionScript
mit
lancecarlson/flails,lancecarlson/flails
b9d05ab7c28d46cd78ed67539719266e6a2be545
collect-client/src/generated/flex/org/openforis/collect/metamodel/proxy/UITabSetProxy.as
collect-client/src/generated/flex/org/openforis/collect/metamodel/proxy/UITabSetProxy.as
/** * Generated by Gas3 v2.3.0 (Granite Data Services). * * NOTE: this file is only generated if it does not exist. You may safely put * your custom code here. */ package org.openforis.collect.metamodel.proxy { import mx.collections.IList; import org.openforis.collect.util.CollectionUtil; [Bindable] [RemoteClass(alias="org.openforis.collect.metamodel.proxy.UITabSetProxy")] public class UITabSetProxy extends UITabSetProxyBase { public function getTab(name:String):UITabProxy { var stack:Array = new Array(); stack.push(tabs); while (stack.length > 0) { var tabs:IList = stack.pop(); for each(var tab:UITabProxy in tabs) { if(tab.name == name) { return tab; } if ( CollectionUtil.isNotEmpty(tab.tabs) ) { stack.push(tab.tabs); } } } return null; } } }
/** * Generated by Gas3 v2.3.0 (Granite Data Services). * * NOTE: this file is only generated if it does not exist. You may safely put * your custom code here. */ package org.openforis.collect.metamodel.proxy { import mx.collections.IList; import org.openforis.collect.util.CollectionUtil; [Bindable] [RemoteClass(alias="org.openforis.collect.metamodel.proxy.UITabSetProxy")] public class UITabSetProxy extends UITabSetProxyBase { public function getTab(name:String):UITabProxy { var stack:Array = new Array(); stack.push(this.tabs); while (stack.length > 0) { var currentTabs:IList = stack.pop(); for each(var tab:UITabProxy in currentTabs) { if(tab.name == name) { return tab; } if ( CollectionUtil.isNotEmpty(tab.tabs) ) { stack.push(tab.tabs); } } } return null; } } }
Fix unexpected behavior with nested tabs
Fix unexpected behavior with nested tabs
ActionScript
mit
openforis/collect,openforis/collect,openforis/collect,openforis/collect
ee53a0253c3012d5673767ec32fd7fabf73c324d
src/laml/display/Skin.as
src/laml/display/Skin.as
package laml.display { import flash.display.DisplayObject; import flash.display.Sprite; public class Skin extends Sprite implements ISkin { public function getBitmapByName(alias:String):DisplayObject { if(hasOwnProperty(alias)) { return new this[alias]() as DisplayObject; } return null; } } }
package laml.display { import flash.display.DisplayObject; import flash.display.Sprite; import mx.core.BitmapAsset; import mx.core.FontAsset; import mx.core.IFlexAsset; import mx.core.IFlexDisplayObject; import mx.core.SpriteAsset; public class Skin extends Sprite implements ISkin { private var bitmapAsset:BitmapAsset; private var fontAsset:FontAsset; private var iFlexAsset:IFlexAsset; private var iFlexDisplayObject:IFlexDisplayObject; private var spriteAsset:SpriteAsset; public function getBitmapByName(alias:String):DisplayObject { if(hasOwnProperty(alias)) { return new this[alias]() as DisplayObject; } return null; } } }
Put MX dependencies in skin
Put MX dependencies in skin git-svn-id: 02605e11d3a461bc7e12f3f3880edf4b0c8dcfd0@4281 3e7533ad-8678-4d30-8e38-00a379d3f0d0
ActionScript
mit
lukebayes/laml
bff95367e7657906745761bf06f795bb767219e0
src/flails/resource/Resource.as
src/flails/resource/Resource.as
/** * Copyright (c) 2009 Lance Carlson * See LICENSE for full license information. */ package flails.resource { import flails.request.RequestPipe; import flails.request.HTTPClient; import flails.request.ResourcePathBuilder; import flails.request.JSONFilter; import flash.utils.getQualifiedClassName; import mx.core.IMXMLObject; public class Resource { public var name:String; public var instanceClass:Class; public function Resource() {} public function initialized(parent:Object, id:String):void { } public function index(resultHandler:Function, errorHandler:Function = null):void { requestPipe(resultHandler, errorHandler).index(); } public function show(id:Number, resultHandler:Function, errorHandler:Function = null):void { requestPipe(resultHandler, errorHandler).show(id); } public function requestPipe(resultHandler:Function, errorHandler:Function):RequestPipe { // TODO: The pluralization obviously needs to be taken care of var pipe:RequestPipe = new HTTPClient(new ResourcePathBuilder(name), new JSONFilter(instanceClass)); pipe.addEventListener("result", resultHandler); return pipe; } } }
/** * Copyright (c) 2009 Lance Carlson * See LICENSE for full license information. */ package flails.resource { import flails.request.RequestPipe; import flails.request.HTTPClient; import flails.request.ResourcePathBuilder; import flails.request.JSONFilter; import mx.core.IMXMLObject; public class Resource implements IMXMLObject { public var name:String; public var instanceClass:Class; public function Resource() {} public function initialized(parent:Object, id:String):void { if (name == null) throw new Error("Name not set for resource."); if (instanceClass == null) instanceClass = Record; } public function index(resultHandler:Function, errorHandler:Function = null):void { requestPipe(resultHandler, errorHandler).index(); } public function show(id:Number, resultHandler:Function, errorHandler:Function = null):void { requestPipe(resultHandler, errorHandler).show(id); } public function requestPipe(resultHandler:Function, errorHandler:Function):RequestPipe { // TODO: The pluralization obviously needs to be taken care of var pipe:RequestPipe = new HTTPClient(new ResourcePathBuilder(name), new JSONFilter(instanceClass)); pipe.addEventListener("result", resultHandler); return pipe; } } }
Implement IMXMLObject. Some defaults and checks.
Implement IMXMLObject. Some defaults and checks.
ActionScript
mit
lancecarlson/flails,lancecarlson/flails
736682536f49fd2ff75131649a522c519d6d3022
dolly-framework/src/test/actionscript/dolly/CloningOfCompositeCloneableClassTest.as
dolly-framework/src/test/actionscript/dolly/CloningOfCompositeCloneableClassTest.as
package dolly { import dolly.core.dolly_internal; import dolly.data.CompositeCloneableClass; import org.as3commons.reflect.Type; use namespace dolly_internal; public class CloningOfCompositeCloneableClassTest { private var compositeCloneableClass:CompositeCloneableClass; private var compositeCloneableClassType:Type; [Before] public function before():void { compositeCloneableClass = new CompositeCloneableClass(); compositeCloneableClassType = Type.forInstance(compositeCloneableClass); } [After] public function after():void { compositeCloneableClass = null; compositeCloneableClassType = null; } } }
package dolly { import dolly.core.dolly_internal; import dolly.data.CompositeCloneableClass; import org.as3commons.reflect.Field; import org.as3commons.reflect.Type; import org.flexunit.asserts.assertEquals; import org.flexunit.asserts.assertNotNull; use namespace dolly_internal; public class CloningOfCompositeCloneableClassTest { private var compositeCloneableClass:CompositeCloneableClass; private var compositeCloneableClassType:Type; [Before] public function before():void { compositeCloneableClass = new CompositeCloneableClass(); compositeCloneableClassType = Type.forInstance(compositeCloneableClass); } [After] public function after():void { compositeCloneableClass = null; compositeCloneableClassType = null; } [Test] public function findingAllWritableFieldsForType():void { const writableFields:Vector.<Field> = Cloner.findAllWritableFieldsForType(compositeCloneableClassType); assertNotNull(writableFields); assertEquals(4, writableFields.length); } } }
Test for calculation of cloneable fields in CompositeCloneableClass.
Test for calculation of cloneable fields in CompositeCloneableClass.
ActionScript
mit
Yarovoy/dolly
5ea2fefddeb6cd9681f0e8bdc2fd5c7214105327
dolly-framework/src/test/actionscript/dolly/CloningOfCompositeCloneableClassTest.as
dolly-framework/src/test/actionscript/dolly/CloningOfCompositeCloneableClassTest.as
package dolly { import dolly.core.dolly_internal; import dolly.data.CompositeCloneableClass; import org.as3commons.reflect.Field; import org.as3commons.reflect.Type; import org.flexunit.asserts.assertEquals; import org.flexunit.asserts.assertNotNull; use namespace dolly_internal; public class CloningOfCompositeCloneableClassTest { private var compositeCloneableClass:CompositeCloneableClass; private var compositeCloneableClassType:Type; [Before] public function before():void { compositeCloneableClass = new CompositeCloneableClass(); compositeCloneableClassType = Type.forInstance(compositeCloneableClass); } [After] public function after():void { compositeCloneableClass = null; compositeCloneableClassType = null; } [Test] public function findingAllWritableFieldsForType():void { const writableFields:Vector.<Field> = Cloner.findAllWritableFieldsForType(compositeCloneableClassType); assertNotNull(writableFields); assertEquals(4, writableFields.length); } } }
package dolly { import dolly.core.dolly_internal; import dolly.data.CompositeCloneableClass; import org.as3commons.reflect.Field; import org.as3commons.reflect.Type; import org.flexunit.asserts.assertEquals; import org.flexunit.asserts.assertFalse; import org.flexunit.asserts.assertNotNull; import org.hamcrest.assertThat; import org.hamcrest.collection.array; import org.hamcrest.collection.arrayWithSize; import org.hamcrest.collection.everyItem; import org.hamcrest.core.isA; import org.hamcrest.object.equalTo; use namespace dolly_internal; public class CloningOfCompositeCloneableClassTest { private var compositeCloneableClass:CompositeCloneableClass; private var compositeCloneableClassType:Type; [Before] public function before():void { compositeCloneableClass = new CompositeCloneableClass(); compositeCloneableClassType = Type.forInstance(compositeCloneableClass); } [After] public function after():void { compositeCloneableClass = null; compositeCloneableClassType = null; } [Test] public function findingAllWritableFieldsForType():void { const writableFields:Vector.<Field> = Cloner.findAllWritableFieldsForType(compositeCloneableClassType); assertNotNull(writableFields); assertEquals(4, writableFields.length); } [Test] public function cloningOfArray():void { const clone:CompositeCloneableClass = Cloner.clone(compositeCloneableClass); assertNotNull(clone.array); assertThat(clone.array, arrayWithSize(5)); assertThat(clone.array, compositeCloneableClass.array); assertFalse(clone.array == compositeCloneableClass.array); assertThat(clone.array, everyItem(isA(Number))); assertThat(clone.array, array(equalTo(0), equalTo(1), equalTo(2), equalTo(3), equalTo(4))); } } }
Test for cloning array in CompositeCloneableClass.
Test for cloning array in CompositeCloneableClass.
ActionScript
mit
Yarovoy/dolly
8eb7d7978dfd82a0b5f3b21ab5ec2a462bef3aa1
FlexUnit4/src/org/flexunit/events/UnknownError.as
FlexUnit4/src/org/flexunit/events/UnknownError.as
package org.flexunit.events { import flash.events.ErrorEvent; import flash.events.Event; public class UnknownError extends Error { public function UnknownError( event:Event ) { var error:Error; if ( event.hasOwnProperty( "error" ) ) { var errorGeneric:* = event[ "error" ]; if ( errorGeneric is Error ) { error = errorGeneric as Error; } else if ( errorGeneric is ErrorEvent ) { var errorEvent:ErrorEvent = errorGeneric as ErrorEvent; error = new Error( "Top Level Error", errorEvent.errorID ); } } super( error.message, error.errorID ); } } }
package org.flexunit.events { import flash.events.ErrorEvent; import flash.events.Event; public class UnknownError extends Error { public function UnknownError( event:Event ) { var error:Error; if ( event.hasOwnProperty( "error" ) ) { var errorGeneric:* = event[ "error" ]; if ( errorGeneric is Error ) { error = errorGeneric as Error; } else if ( errorGeneric is ErrorEvent ) { var errorEvent:ErrorEvent = errorGeneric as ErrorEvent; error = new Error( "Top Level Error", Object(errorEvent).errorID ); } } super( error.message, error.errorID ); } } }
Fix for build issue around unknown error
Fix for build issue around unknown error
ActionScript
apache-2.0
SlavaRa/flex-flexunit,apache/flex-flexunit,apache/flex-flexunit,apache/flex-flexunit,SlavaRa/flex-flexunit,SlavaRa/flex-flexunit,apache/flex-flexunit,SlavaRa/flex-flexunit
9cb51568c37c5ffec45d001c69cae5d3969cfb83
plugins/wvPlugin/src/com/kaltura/kdpfl/plugin/WVLoader.as
plugins/wvPlugin/src/com/kaltura/kdpfl/plugin/WVLoader.as
package com.kaltura.kdpfl.plugin { import org.osmf.traits.LoaderBase; public class WVLoader extends LoaderBase { public function WVLoader() { super(); } } }
package com.kaltura.kdpfl.plugin { import flash.external.ExternalInterface; import org.osmf.media.MediaResourceBase; import org.osmf.traits.LoaderBase; public class WVLoader extends LoaderBase { public function WVLoader() { super(); } override public function canHandleResource(resource:MediaResourceBase):Boolean { if (resource.hasOwnProperty("url") && resource["url"].toString().indexOf(".wvm") > -1 ) { try { ExternalInterface.call("mediaURL" , resource["url"].toString()); } catch(error:Error) { trace("Failed to call external interface"); } return true; } return false; } } }
Fix a bug that caused "ChangeMedia" to fail
Fix a bug that caused "ChangeMedia" to fail
ActionScript
agpl-3.0
kaltura/kdp,shvyrev/kdp,shvyrev/kdp,shvyrev/kdp,kaltura/kdp,kaltura/kdp
a52512f1414c32c6b96c98965148f4a97ec4c3dd
src/goplayer/FlashContentLoadAttempt.as
src/goplayer/FlashContentLoadAttempt.as
package goplayer { import flash.display.Loader import flash.events.Event import flash.events.IOErrorEvent import flash.net.URLRequest import flash.system.ApplicationDomain import flash.system.LoaderContext import flash.system.SecurityDomain public class FlashContentLoadAttempt { private const loader : Loader = new Loader private var url : String private var listener : FlashContentLoaderListener public function FlashContentLoadAttempt (url : String, listener : FlashContentLoaderListener) { this.url = url, this.listener = listener loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handleContentLoaded) loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, handleIOError) } public function execute() : void { loader.load(new URLRequest(url)) } private function handleContentLoaded(event : Event) : void { listener.handleContentLoaded(loader.contentLoaderInfo) } private function handleIOError(event : IOErrorEvent) : void { debug("Failed to load <" + url + ">: " + event.text) } } }
package goplayer { import flash.display.Loader import flash.events.Event import flash.events.IOErrorEvent import flash.net.URLRequest import flash.system.ApplicationDomain import flash.system.LoaderContext import flash.system.SecurityDomain public class FlashContentLoadAttempt { private const loader : Loader = new Loader private var url : String private var listener : FlashContentLoaderListener public function FlashContentLoadAttempt (url : String, listener : FlashContentLoaderListener) { this.url = url, this.listener = listener loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handleContentLoaded) loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, handleIOError) } public function execute() : void { loader.load(new URLRequest(url)) } private function handleContentLoaded(event : Event) : void { listener.handleContentLoaded(loader.contentLoaderInfo) } private function handleIOError(event : IOErrorEvent) : void { const code : String = event.text.match(/^Error #(\d+)/)[1] const message : String = code == "2035" ? "Not found" : event.text debug("Error: Failed to load <" + url + ">: " + message) } } }
Improve error handling of external content loading.
Improve error handling of external content loading.
ActionScript
mit
dbrock/goplayer,dbrock/goplayer
9048d4b0250a6742f81712f65cccf04c0be4aa94
src/aerys/minko/render/effect/vertex/VertexUVShader.as
src/aerys/minko/render/effect/vertex/VertexUVShader.as
package aerys.minko.render.effect.vertex { import aerys.minko.render.RenderTarget; import aerys.minko.render.effect.basic.BasicProperties; import aerys.minko.render.effect.basic.BasicShader; import aerys.minko.render.shader.SFloat; import aerys.minko.type.stream.format.VertexComponent; public class VertexUVShader extends BasicShader { public function VertexUVShader(target : RenderTarget = null, priority : Number = 0) { super(target, priority); } override protected function getPixelColor() : SFloat { var uv : SFloat = getVertexAttribute(VertexComponent.UV); if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_SCALE)) uv.scaleBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_SCALE, 2)); if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_OFFSET)) uv.incrementBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_OFFSET, 2)); var interpolatedUv : SFloat = fractional(interpolate(uv)); return float4(interpolatedUv.x, interpolatedUv.y, 0, 1); } } }
package aerys.minko.render.effect.vertex { import aerys.minko.render.RenderTarget; import aerys.minko.render.effect.basic.BasicProperties; import aerys.minko.render.effect.basic.BasicShader; import aerys.minko.render.shader.SFloat; import aerys.minko.type.stream.format.VertexComponent; public class VertexUVShader extends BasicShader { public function VertexUVShader(target : RenderTarget = null, priority : Number = 0) { super(target, priority); } override protected function getPixelColor() : SFloat { var uv : SFloat = getVertexAttribute(VertexComponent.UV); if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_SCALE)) uv.scaleBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_SCALE, 2)); if (meshBindings.propertyExists(BasicProperties.DIFFUSE_UV_OFFSET)) uv.incrementBy(meshBindings.getParameter(BasicProperties.DIFFUSE_UV_OFFSET, 2)); uv = interpolate(uv); var fractional : SFloat = fractional(uv); var fractionalIsZero : SFloat = equal(fractional, float2(0, 0)); var interpolatedUv : SFloat = add( multiply(not(fractionalIsZero), fractional), multiply(fractionalIsZero, saturate(uv)) ); return float4(interpolatedUv.x, interpolatedUv.y, 0, 1); } } }
Optimize uv shader for limit values
Optimize uv shader for limit values
ActionScript
mit
aerys/minko-as3
912692ea30af1f186de02f86b8a0687523e9c7e9
dolly-framework/src/test/resources/dolly/ClassWithSomeCopyableFields.as
dolly-framework/src/test/resources/dolly/ClassWithSomeCopyableFields.as
package dolly { public class ClassWithSomeCopyableFields { public static var staticProperty1:String; [Cloneable] public static var staticProperty2:String; [Cloneable] public static var staticProperty3:String; private var _writableField:String; private var _readOnlyField:String = "read-only field value"; public var property1:String; [Cloneable] public var property2:String; [Cloneable] public var property3:String; public function ClassWithSomeCopyableFields() { } [Cloneable] public function get writableField():String { return _writableField; } public function set writableField(value:String):void { _writableField = value; } [Cloneable] public function get readOnlyField():String { return _readOnlyField; } } }
package dolly { public class ClassWithSomeCopyableFields { public static var staticProperty1:String; [Copyable] public static var staticProperty2:String; [Copyable] public static var staticProperty3:String; private var _writableField:String; private var _readOnlyField:String = "read-only field value"; public var property1:String; [Copyable] public var property2:String; [Copyable] public var property3:String; public function ClassWithSomeCopyableFields() { } [Copyable] public function get writableField():String { return _writableField; } public function set writableField(value:String):void { _writableField = value; } [Copyable] public function get readOnlyField():String { return _readOnlyField; } } }
Change metadata tags to Copyable in test data class.
Change metadata tags to Copyable in test data class.
ActionScript
mit
Yarovoy/dolly
5f9b770ac4d5d2b6799009db942e4bfcd3ffb7bc
src/goplayer/FlashContentLoadAttempt.as
src/goplayer/FlashContentLoadAttempt.as
package goplayer { import flash.display.Loader import flash.events.Event import flash.events.IOErrorEvent import flash.net.URLRequest import flash.system.ApplicationDomain import flash.system.LoaderContext import flash.system.SecurityDomain public class FlashContentLoadAttempt { private const loader : Loader = new Loader private var url : String private var listener : FlashContentLoaderListener public function FlashContentLoadAttempt (url : String, listener : FlashContentLoaderListener) { this.url = url, this.listener = listener loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handleContentLoaded) loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, handleIOError) } public function execute() : void { loader.load(new URLRequest(url)) } private function get loaderContext() : LoaderContext { const result : LoaderContext = new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain)) result.securityDomain = SecurityDomain.currentDomain return result } private function handleContentLoaded(event : Event) : void { listener.handleContentLoaded(loader.contentLoaderInfo) } private function handleIOError(event : IOErrorEvent) : void { debug("Failed to load <" + url + ">: " + event.text) } } }
package goplayer { import flash.display.Loader import flash.events.Event import flash.events.IOErrorEvent import flash.net.URLRequest import flash.system.ApplicationDomain import flash.system.LoaderContext import flash.system.SecurityDomain public class FlashContentLoadAttempt { private const loader : Loader = new Loader private var url : String private var listener : FlashContentLoaderListener public function FlashContentLoadAttempt (url : String, listener : FlashContentLoaderListener) { this.url = url, this.listener = listener loader.contentLoaderInfo.addEventListener (Event.COMPLETE, handleContentLoaded) loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, handleIOError) } public function execute() : void { loader.load(new URLRequest(url)) } private function handleContentLoaded(event : Event) : void { listener.handleContentLoaded(loader.contentLoaderInfo) } private function handleIOError(event : IOErrorEvent) : void { debug("Failed to load <" + url + ">: " + event.text) } } }
Remove custom LoaderContext creation code.
Remove custom LoaderContext creation code.
ActionScript
mit
dbrock/goplayer,dbrock/goplayer
7c291f387d8af2946b6407ef5a5cde2cb58958f3
src/main/as/flump/export/PackedTexture.as
src/main/as/flump/export/PackedTexture.as
// // Flump - Copyright 2012 Three Rings Design package flump.export { import flash.display.DisplayObject; import flash.display.Sprite; import flash.geom.Point; import flash.geom.Rectangle; import flump.xfl.XflTexture; public class PackedTexture { public const holder :Sprite = new Sprite(); public var tex :XflTexture; public var offset :Point; public var w :int, h :int, a :int; public var atlasX :int, atlasY :int; public var atlasRotated :Boolean; public function PackedTexture (tex :XflTexture, image :DisplayObject) { this.tex = tex; holder.addChild(image); const bounds :Rectangle = image.getBounds(holder); offset = new Point(bounds.x, bounds.y); w = Math.ceil(bounds.width); h = Math.ceil(bounds.height); a = w * h; } public function toString () :String { return "a " + a + " w " + w + " h " + h + " atlas " + atlasX + ", " + atlasY; } } }
// // Flump - Copyright 2012 Three Rings Design package flump.export { import flash.display.DisplayObject; import flash.display.Sprite; import flash.geom.Point; import flash.geom.Rectangle; import flump.xfl.XflTexture; public class PackedTexture { public const holder :Sprite = new Sprite(); public var tex :XflTexture; public var offset :Point; public var w :int, h :int, a :int; public var atlasX :int, atlasY :int; public var atlasRotated :Boolean; public function PackedTexture (tex :XflTexture, image :DisplayObject) { this.tex = tex; holder.addChild(image); const bounds :Rectangle = image.getBounds(holder); image.x = -bounds.x; image.y = -bounds.y; offset = new Point(bounds.x, bounds.y); w = Math.ceil(bounds.width); h = Math.ceil(bounds.height); a = w * h; } public function toString () :String { return "a " + a + " w " + w + " h " + h + " atlas " + atlasX + ", " + atlasY; } } }
Move the images by their offset
Move the images by their offset
ActionScript
mit
funkypandagame/flump,tconkling/flump,funkypandagame/flump,tconkling/flump,mathieuanthoine/flump,mathieuanthoine/flump,mathieuanthoine/flump
51cf6b65bec7c91b21172fff6224855f503e01fa
src/as/com/threerings/flex/FlexWrapper.as
src/as/com/threerings/flex/FlexWrapper.as
// // $Id$ // // Nenya library - tools for developing networked games // Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/nenya/ // // This library 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. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package com.threerings.flex { import flash.display.DisplayObject; import mx.core.UIComponent; /** * Wraps a non-Flex component for use in Flex. */ public class FlexWrapper extends UIComponent { public function FlexWrapper (object :DisplayObject) { // don't capture mouse events in this wrapper mouseEnabled = false; addChild(object); width = object.width; height = object.height; } } }
// // $Id$ // // Nenya library - tools for developing networked games // Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved // http://www.threerings.net/code/nenya/ // // This library 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. // // This library 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 this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package com.threerings.flex { import flash.display.DisplayObject; import mx.core.UIComponent; /** * Wraps a non-Flex component for use in Flex. */ public class FlexWrapper extends UIComponent { public function FlexWrapper (object :DisplayObject, inheritSize :Boolean = false) { // don't capture mouse events in this wrapper mouseEnabled = false; addChild(object); if (inheritSize) { width = object.width; height = object.height; } } } }
Make this optional, and not the default. Turns out a bunch of shit makes the wrapper size a little bigger, and some things seem to freak out when the wrapper has a size, even when includeInLayout=false. Flex you very much.
Make this optional, and not the default. Turns out a bunch of shit makes the wrapper size a little bigger, and some things seem to freak out when the wrapper has a size, even when includeInLayout=false. Flex you very much. git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@616 ed5b42cb-e716-0410-a449-f6a68f950b19
ActionScript
lgpl-2.1
threerings/nenya,threerings/nenya
60ec297e24004ef5f50d8dae05c3313e99d3263a
src/stdio/Sprite.as
src/stdio/Sprite.as
package stdio { import flash.display.* import flash.utils.getQualifiedClassName import flash.utils.setTimeout public class Sprite extends flash.display.Sprite { public function Sprite() { stage.scaleMode = StageScaleMode.NO_SCALE stage.align = StageAlign.TOP_LEFT // Let the subclass constructor run first. setTimeout(initialize, 0) } private function initialize(): void { setup(loaderInfo, this, start) } private function start(): void { if ("main" in this && this["main"].length === 0) { this["main"]() } else { warn("Please write your main method like this:") warn("public function main(): void {}") process.exit(1) } } private function warn(message: String): void { process.warn(getQualifiedClassName(this) + ": " + message) } } }
package stdio { import flash.display.* import flash.utils.getQualifiedClassName import flash.utils.setTimeout public class Sprite extends flash.display.Sprite { public function Sprite() { if (stage) { stage.scaleMode = StageScaleMode.NO_SCALE stage.align = StageAlign.TOP_LEFT } // Let the subclass constructor run first. setTimeout(initialize, 0) } private function initialize(): void { setup(loaderInfo, this, start) } private function start(): void { if ("main" in this && this["main"].length === 0) { this["main"]() } else { warn("Please write your main method like this:") warn("public function main(): void {}") process.exit(1) } } private function warn(message: String): void { process.warn(getQualifiedClassName(this) + ": " + message) } } }
Fix bug preventing running processes recursively.
Fix bug preventing running processes recursively.
ActionScript
mit
dbrock/stdio.as,dbrock/stdio.as,dbrock/stdio.as
14e29c99fbaba25aace6714949c3cca398c89643
bin/Data/Scripts/Main.as
bin/Data/Scripts/Main.as
Scene@ newScene_; Scene@ scene_; Camera@ camera_; void Start() { StartScene("Scenes/Level1.xml"); SubscribeToEvent("LevelComplete", "HandleLevelComplete"); } void Stop() { } void HandleLevelComplete(StringHash type, VariantMap& data) { log.Debug("Level Complete. I should be loading "+data["NextLevel"].GetString()); StartScene(data["NextLevel"].GetString()); } void StartScene(String scene) { newScene_ = Scene(); newScene_.LoadAsyncXML(cache.GetFile(scene)); SubscribeToEvent("AsyncLoadFinished", "HandleAsyncLoadFinished"); } void HandleAsyncLoadFinished(StringHash type, VariantMap& data) { UnsubscribeFromEvent("AsyncLoadFinished"); newScene_ = data["Scene"].GetPtr(); SubscribeToEvent("Update", "HandleDelayedStart"); } void HandleDelayedStart(StringHash type, VariantMap& data) { UnsubscribeFromEvent("Update"); Node@ cameraNode = newScene_.GetChild("Camera", true); Camera@ newCamera = cameraNode.CreateComponent("Camera"); Viewport@ viewport = Viewport(newScene_, cameraNode.GetComponent("Camera")); renderer.viewports[0] = viewport; scene_ = newScene_; camera_ = newCamera; newScene_ = null; }
Scene@ newScene_; Scene@ scene_; Camera@ camera_; Timer timer_; void Start() { StartScene("Scenes/Level1.xml"); SubscribeToEvent("LevelComplete", "HandleLevelComplete"); } void Stop() { } void HandleLevelComplete(StringHash type, VariantMap& data) { log.Debug("Level Complete. I should be loading "+data["NextLevel"].GetString()); float timeTaken = timer_.GetMSec(false); log.Debug("You took " + timeTaken / 1000.f + " seconds to solve the level"); StartScene(data["NextLevel"].GetString()); } void StartScene(String scene) { newScene_ = Scene(); newScene_.LoadAsyncXML(cache.GetFile(scene)); SubscribeToEvent("AsyncLoadFinished", "HandleAsyncLoadFinished"); } void HandleAsyncLoadFinished(StringHash type, VariantMap& data) { UnsubscribeFromEvent("AsyncLoadFinished"); newScene_ = data["Scene"].GetPtr(); SubscribeToEvent("Update", "HandleDelayedStart"); } void HandleDelayedStart(StringHash type, VariantMap& data) { UnsubscribeFromEvent("Update"); Node@ cameraNode = newScene_.GetChild("Camera", true); Camera@ newCamera = cameraNode.CreateComponent("Camera"); Viewport@ viewport = Viewport(newScene_, cameraNode.GetComponent("Camera")); renderer.viewports[0] = viewport; scene_ = newScene_; camera_ = newCamera; newScene_ = null; timer_.Reset(); }
Add a level timer to the main procedure
Add a level timer to the main procedure
ActionScript
mit
leyarotheconquerer/on-off
59c6998c30630453371516f40bfa19f6fd24cf36
src/as/com/threerings/flash/FrameSprite.as
src/as/com/threerings/flash/FrameSprite.as
// // $Id$ package com.threerings.flash { import flash.display.Sprite; import flash.events.Event; /** * Convenience superclass to use for sprites that need to update every frame. * (One must be very careful to remove all ENTER_FRAME listeners when not needed, as they * will prevent an object from being garbage collected!) */ public class FrameSprite extends Sprite { public function FrameSprite () { addEventListener(Event.ADDED_TO_STAGE, handleAdded); addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved); } /** * Called when we're added to the stage. */ protected function handleAdded (... ignored) :void { addEventListener(Event.ENTER_FRAME, handleFrame); handleFrame(); // update immediately } /** * Called when we're added to the stage. */ protected function handleRemoved (... ignored) :void { removeEventListener(Event.ENTER_FRAME, handleFrame); } /** * Called to update our visual appearance prior to each frame. */ protected function handleFrame (... ignored) :void { // nothing here. Override in yor subclass. } } }
// // $Id$ package com.threerings.flash { import flash.display.Sprite; import flash.events.Event; /** * Convenience superclass to use for sprites that need to update every frame. * (One must be very careful to remove all ENTER_FRAME listeners when not needed, as they * will prevent an object from being garbage collected!) */ public class FrameSprite extends Sprite { /** * @param renderFrameUponAdding if true, the handleFrame() method * is called whenever an ADDED_TO_STAGE event is received. */ public function FrameSprite (renderFrameUponAdding :Boolean = true) { _renderOnAdd = renderFrameUponAdding; addEventListener(Event.ADDED_TO_STAGE, handleAdded); addEventListener(Event.REMOVED_FROM_STAGE, handleRemoved); } /** * Called when we're added to the stage. */ protected function handleAdded (... ignored) :void { addEventListener(Event.ENTER_FRAME, handleFrame); if (_renderOnAdd) { handleFrame(); // update immediately } } /** * Called when we're added to the stage. */ protected function handleRemoved (... ignored) :void { removeEventListener(Event.ENTER_FRAME, handleFrame); } /** * Called to update our visual appearance prior to each frame. */ protected function handleFrame (... ignored) :void { // nothing here. Override in yor subclass. } /** Should we call handleFrame() when we get ADDED_TO_STAGE? */ protected var _renderOnAdd :Boolean; } }
Allow subclasses to choose not to call handleFrame() when ADDED_TO_STAGE is received.
Allow subclasses to choose not to call handleFrame() when ADDED_TO_STAGE is received. git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@253 ed5b42cb-e716-0410-a449-f6a68f950b19
ActionScript
lgpl-2.1
threerings/nenya,threerings/nenya
074ee8976d0c8c96773a51f3a81f0bede4f50177
src/main/flex/org/servebox/cafe/core/application/Application.as
src/main/flex/org/servebox/cafe/core/application/Application.as
package org.servebox.cafe.core.application { import org.servebox.cafe.core.spring.ApplicationContext; import spark.components.Application; public class Application extends spark.components.Application implements CafeApplication { private var _context : ApplicationContext; public function Application() { super(); ApplicationInitializer.prepare( this ); _context = ApplicationInitializer.getDefaultContext(); } public function getContext():ApplicationContext { return null; } } }
package org.servebox.cafe.core.application { import org.servebox.cafe.core.spring.ApplicationContext; import spark.components.Application; public class Application extends spark.components.Application implements CafeApplication { private var _context : ApplicationContext; public function Application() { super(); ApplicationInitializer.prepare( this ); _context = ApplicationInitializer.getDefaultContext(); } public function getContext():ApplicationContext { return _context; } } }
Fix bug on getContext() null
Fix bug on getContext() null
ActionScript
mit
servebox/as-cafe
d1d2f358c84830e4266273cb1d2ab5179695b0e1
src/util-events.ads
src/util-events.ads
----------------------------------------------------------------------- -- util-events -- Events -- Copyright (C) 2001, 2002, 2003, 2009, 2010 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Calendar; package Util.Events is type Event is tagged private; -- Get the time identifying when the event was created. function Get_Time (Ev : Event) return Ada.Calendar.Time; type Event_Listener is limited interface; private type Event is tagged record Date : Ada.Calendar.Time := Ada.Calendar.Clock; end record; end Util.Events;
----------------------------------------------------------------------- -- util-events -- Events -- Copyright (C) 2001, 2002, 2003, 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Calendar; package Util.Events is type Event is tagged limited private; -- Get the time identifying when the event was created. function Get_Time (Ev : Event) return Ada.Calendar.Time; type Event_Listener is limited interface; private type Event is tagged limited record Date : Ada.Calendar.Time := Ada.Calendar.Clock; end record; end Util.Events;
Change the Event type to a limited type
Change the Event type to a limited type
Ada
apache-2.0
Letractively/ada-util,flottokarotto/ada-util,Letractively/ada-util,flottokarotto/ada-util
03237add331b06e61a262343dcd94772313315e7
src/gen-commands-info.ads
src/gen-commands-info.ads
----------------------------------------------------------------------- -- gen-commands-info -- Collect and give information about the project -- Copyright (C) 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Info is -- ------------------------------ -- Project Information Command -- ------------------------------ -- This command collects information about the project and print it. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. procedure Execute (Cmd : in Command; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Info;
----------------------------------------------------------------------- -- gen-commands-info -- Collect and give information about the project -- Copyright (C) 2011, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Info is -- ------------------------------ -- Project Information Command -- ------------------------------ -- This command collects information about the project and print it. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Info;
Update to use the new command implementation
Update to use the new command implementation
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
d0ab12f36377fddc0c022062223506a1dc863dbd
src/gen-commands-docs.ads
src/gen-commands-docs.ads
----------------------------------------------------------------------- -- gen-commands-docs -- Extract and generate documentation for the project -- Copyright (C) 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Docs is -- ------------------------------ -- Documentation Command -- ------------------------------ -- This command extracts documentation from the project files and collect them -- together to build the project documentation. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. procedure Execute (Cmd : in Command; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Docs;
----------------------------------------------------------------------- -- gen-commands-docs -- Extract and generate documentation for the project -- Copyright (C) 2012, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Docs is -- ------------------------------ -- Documentation Command -- ------------------------------ -- This command extracts documentation from the project files and collect them -- together to build the project documentation. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Docs;
Update to use the new command implementation
Update to use the new command implementation
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
ea4dd9f87719743362a2abfacd4abd89ef217cf7
src/gen-commands-page.ads
src/gen-commands-page.ads
----------------------------------------------------------------------- -- gen-commands-page -- Page creation command for dynamo -- Copyright (C) 2011, 2017, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Page is -- ------------------------------ -- Page Creation Command -- ------------------------------ -- This command adds a XHTML page to the web application. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in out Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in out Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Page;
----------------------------------------------------------------------- -- gen-commands-page -- Page creation command for dynamo -- Copyright (C) 2011, 2017, 2018, 2019 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Page is -- ------------------------------ -- Page Creation Command -- ------------------------------ -- This command adds a XHTML page to the web application. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in out Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in out Command; Name : in String; Generator : in out Gen.Generator.Handler); end Gen.Commands.Page;
Add Name parameter to the Help procedure
Add Name parameter to the Help procedure
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
21f82397c418c064056bbe9a13f43e47129653ff
awa/plugins/awa-questions/regtests/awa-questions-services-tests.ads
awa/plugins/awa-questions/regtests/awa-questions-services-tests.ads
----------------------------------------------------------------------- -- awa-questions-services-tests -- Unit tests for question service -- Copyright (C) 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; package AWA.Questions.Services.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with record Manager : AWA.Questions.Services.Question_Service_Access; end record; -- Test creation of a question. procedure Test_Create_Question (T : in out Test); -- Test list of questions. procedure Test_List_Questions (T : in out Test); end AWA.Questions.Services.Tests;
----------------------------------------------------------------------- -- awa-questions-services-tests -- Unit tests for question service -- Copyright (C) 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; package AWA.Questions.Services.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with record Manager : AWA.Questions.Services.Question_Service_Access; end record; -- Test creation of a question. procedure Test_Create_Question (T : in out Test); -- Test list of questions. procedure Test_List_Questions (T : in out Test); -- Test anonymous user voting for a question. procedure Test_Question_Vote_Anonymous (T : in out Test); -- Test voting for a question. procedure Test_Question_Vote (T : in out Test); private -- Do a vote on a question through the question vote bean. procedure Do_Vote (T : in out Test); end AWA.Questions.Services.Tests;
Add unit tests for the questionVote bean
Add unit tests for the questionVote bean
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
024e51ab76465425bc7eb8a738bb5b64cd1f45ea
src/gen-commands-layout.ads
src/gen-commands-layout.ads
----------------------------------------------------------------------- -- gen-commands-layout -- Layout creation command for dynamo -- Copyright (C) 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Layout is -- ------------------------------ -- Layout Creation Command -- ------------------------------ -- This command adds a XHTML layout to the web application. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. procedure Execute (Cmd : in Command; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Layout;
----------------------------------------------------------------------- -- gen-commands-layout -- Layout creation command for dynamo -- Copyright (C) 2011, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Layout is -- ------------------------------ -- Layout Creation Command -- ------------------------------ -- This command adds a XHTML layout to the web application. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Layout;
Update to use the new command implementation
Update to use the new command implementation
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
9a00519d1c63d366087a34d065172766c6535a39
mat/src/mat-readers-files.ads
mat/src/mat-readers-files.ads
----------------------------------------------------------------------- -- mat-readers-files -- Reader for files -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; with Util.Streams.Files; package MAT.Readers.Files is type File_Reader_Type is new Manager_Base with private; -- Open the file. procedure Open (Reader : in out File_Reader_Type; Path : in String); procedure Read_All (Reader : in out File_Reader_Type); private type File_Reader_Type is new Manager_Base with record File : aliased Util.Streams.Files.File_Stream; Stream : Util.Streams.Buffered.Buffered_Stream; end record; end MAT.Readers.Files;
----------------------------------------------------------------------- -- mat-readers-files -- Reader for files -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; with Util.Streams.Files; with MAT.Readers.Streams; package MAT.Readers.Files is type File_Reader_Type is new MAT.Readers.Streams.Stream_Reader_Type with private; -- Open the file. procedure Open (Reader : in out File_Reader_Type; Path : in String); private type File_Reader_Type is new MAT.Readers.Streams.Stream_Reader_Type with record File : aliased Util.Streams.Files.File_Stream; end record; end MAT.Readers.Files;
Use the MAT.Readers.Streams package for the file reader implementation
Use the MAT.Readers.Streams package for the file reader implementation
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
a8a3b7f6797a6c27d37d3031e130f52fec143a91
regtests/ado-drivers-tests.ads
regtests/ado-drivers-tests.ads
----------------------------------------------------------------------- -- ado-drivers-tests -- Unit tests for database drivers -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package ADO.Drivers.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test the Get_Config operation. procedure Test_Get_Config (T : in out Test); -- Test the Get_Driver operation. procedure Test_Get_Driver (T : in out Test); -- Test loading some invalid database driver. procedure Test_Load_Invalid_Driver (T : in out Test); -- Test the Get_Driver_Index operation. procedure Test_Get_Driver_Index (T : in out Test); end ADO.Drivers.Tests;
----------------------------------------------------------------------- -- ado-drivers-tests -- Unit tests for database drivers -- Copyright (C) 2014, 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package ADO.Drivers.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test the Get_Config operation. procedure Test_Get_Config (T : in out Test); -- Test the Get_Driver operation. procedure Test_Get_Driver (T : in out Test); -- Test loading some invalid database driver. procedure Test_Load_Invalid_Driver (T : in out Test); -- Test the Get_Driver_Index operation. procedure Test_Get_Driver_Index (T : in out Test); -- Test the Set_Connection procedure with several error cases. procedure Test_Set_Connection_Error (T : in out Test); end ADO.Drivers.Tests;
Declare the Test_Set_Connection_Error test procedure
Declare the Test_Set_Connection_Error test procedure
Ada
apache-2.0
stcarrez/ada-ado
6ae7c11cfd399db0f9bf3285cc2a41ac08658d44
tools/druss-commands-status.ads
tools/druss-commands-status.ads
----------------------------------------------------------------------- -- druss-commands-status -- Druss status commands -- Copyright (C) 2017, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Druss.Commands.Status is type Command_Type is new Druss.Commands.Drivers.Command_Type with null record; procedure Do_Status (Command : in Command_Type; Args : in Argument_List'Class; Context : in out Context_Type); -- Execute a status command to report information about the Bbox. overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type); -- Write the help associated with the command. overriding procedure Help (Command : in Command_Type; Context : in out Context_Type); end Druss.Commands.Status;
----------------------------------------------------------------------- -- druss-commands-status -- Druss status commands -- Copyright (C) 2017, 2018, 2019 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Druss.Commands.Status is type Command_Type is new Druss.Commands.Drivers.Command_Type with null record; procedure Do_Status (Command : in Command_Type; Args : in Argument_List'Class; Context : in out Context_Type); -- Execute a status command to report information about the Bbox. overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type); -- Write the help associated with the command. overriding procedure Help (Command : in out Command_Type; Context : in out Context_Type); end Druss.Commands.Status;
Change Help command to accept in out command
Change Help command to accept in out command
Ada
apache-2.0
stcarrez/bbox-ada-api
655325db4f269f9472a62ac3a5ae49763ffaae64
mat/src/mat-readers-streams.ads
mat/src/mat-readers-streams.ads
----------------------------------------------------------------------- -- mat-readers-streams -- Reader for streams -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; package MAT.Readers.Streams is type Stream_Reader_Type is new Manager_Base with private; -- Read the events from the stream and stop when the end of the stream is reached. procedure Read_All (Reader : in out Stream_Reader_Type); -- Read a message from the stream. overriding procedure Read_Message (Reader : in out Stream_Reader_Type; Msg : in out Message); private type Stream_Reader_Type is new Manager_Base with record Stream : Util.Streams.Buffered.Buffered_Stream; end record; end MAT.Readers.Streams;
----------------------------------------------------------------------- -- mat-readers-streams -- Reader for streams -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; package MAT.Readers.Streams is type Stream_Reader_Type is new Manager_Base with private; -- Read the events from the stream and stop when the end of the stream is reached. procedure Read_All (Reader : in out Stream_Reader_Type); -- Read a message from the stream. overriding procedure Read_Message (Reader : in out Stream_Reader_Type; Msg : in out Message); private type Stream_Reader_Type is new Manager_Base with record Stream : Util.Streams.Buffered.Buffered_Stream; Data : Util.Streams.Buffered.Buffer_Access; end record; end MAT.Readers.Streams;
Add the data buffer in the Stream_Reader_Type type
Add the data buffer in the Stream_Reader_Type type
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
210d73c3b779f1568daf80f23ca6bd280a3e65cc
awa/regtests/awa_harness.adb
awa/regtests/awa_harness.adb
----------------------------------------------------------------------- -- AWA - Unit tests -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with AWA.Testsuite; with Util.Tests; with AWA.Tests; procedure AWA_Harness is procedure Harness is new Util.Tests.Harness (AWA.Testsuite.Suite, AWA.Tests.Initialize); begin Harness ("awa-tests.xml"); end AWA_Harness;
----------------------------------------------------------------------- -- AWA - Unit tests -- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with AWA.Testsuite; with Util.Tests; with AWA.Tests; procedure AWA_Harness is procedure Harness is new Util.Tests.Harness (AWA.Testsuite.Suite, AWA.Tests.Initialize, AWA.Tests.Finish); begin Harness ("awa-tests.xml"); end AWA_Harness;
Call the Finish procedure after executing the testsuite Finish will destroy the AWA application that was allocated dynamically
Call the Finish procedure after executing the testsuite Finish will destroy the AWA application that was allocated dynamically
Ada
apache-2.0
Letractively/ada-awa,tectronics/ada-awa,Letractively/ada-awa,tectronics/ada-awa,Letractively/ada-awa,tectronics/ada-awa
ad5f598a5a6d99a236054747dccd1f295fe74be9
mat/regtests/mat-testsuite.adb
mat/regtests/mat-testsuite.adb
----------------------------------------------------------------------- -- mat-testsuite - MAT Testsuite -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Readers.Tests; with MAT.Targets.Tests; with MAT.Frames.Tests; with MAT.Memory.Tests; package body MAT.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Result : constant Util.Tests.Access_Test_Suite := Tests'Access; begin MAT.Frames.Tests.Add_Tests (Result); MAT.Memory.Tests.Add_Tests (Result); MAT.Readers.Tests.Add_Tests (Result); MAT.Targets.Tests.Add_Tests (Result); return Result; end Suite; end MAT.Testsuite;
----------------------------------------------------------------------- -- mat-testsuite - MAT Testsuite -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Readers.Tests; with MAT.Targets.Tests; with MAT.Frames.Tests; with MAT.Memory.Tests; with MAT.Expressions.Tests; package body MAT.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Result : constant Util.Tests.Access_Test_Suite := Tests'Access; begin MAT.Expressions.Tests.Add_Tests (Result); MAT.Frames.Tests.Add_Tests (Result); MAT.Memory.Tests.Add_Tests (Result); MAT.Readers.Tests.Add_Tests (Result); MAT.Targets.Tests.Add_Tests (Result); return Result; end Suite; end MAT.Testsuite;
Add the new unit tests
Add the new unit tests
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
fdd736f163dc4171df927ab8958869fa3dd562a9
regtests/util-locales-tests.ads
regtests/util-locales-tests.ads
----------------------------------------------------------------------- -- locales.tests -- Unit tests for Locales -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Util.Locales.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Get_Locale (T : in out Test); procedure Test_Hash_Locale (T : in out Test); procedure Test_Compare_Locale (T : in out Test); procedure Test_Get_Locales (T : in out Test); end Util.Locales.Tests;
----------------------------------------------------------------------- -- util-locales-tests -- Unit tests for Locales -- Copyright (C) 2009, 2010, 2011, 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Util.Locales.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Get_Locale (T : in out Test); procedure Test_Hash_Locale (T : in out Test); procedure Test_Compare_Locale (T : in out Test); procedure Test_Get_Locales (T : in out Test); procedure Test_Null_Locale (T : in out Test); end Util.Locales.Tests;
Declare the new Test_Null_Locale procedure
Declare the new Test_Null_Locale procedure
Ada
apache-2.0
stcarrez/ada-util,stcarrez/ada-util
f7031e582d729d6bf57c2c28a86f9b853167c008
src/definitions.ads
src/definitions.ads
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt package Definitions is pragma Pure; synth_version_major : constant String := "1"; synth_version_minor : constant String := "21"; copyright_years : constant String := "2015-2016"; host_localbase : constant String := "/usr/local"; host_pkg8 : constant String := host_localbase & "/sbin/pkg"; jobs_per_cpu : constant := 2; type cpu_range is range 1 .. 32; type scanners is range cpu_range'First .. cpu_range'Last; type builders is range cpu_range'First .. cpu_range'Last * jobs_per_cpu; end Definitions;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt package Definitions is pragma Pure; synth_version_major : constant String := "1"; synth_version_minor : constant String := "22"; copyright_years : constant String := "2015-2016"; host_localbase : constant String := "/usr/local"; host_pkg8 : constant String := host_localbase & "/sbin/pkg"; jobs_per_cpu : constant := 2; type cpu_range is range 1 .. 32; type scanners is range cpu_range'First .. cpu_range'Last; type builders is range cpu_range'First .. cpu_range'Last * jobs_per_cpu; end Definitions;
Upgrade version 1.21 => 1.22
ports-mgmt/synth: Upgrade version 1.21 => 1.22 Two minor bug fixes: * A specific check during test mode would emit a failure to stdout when testing devel/py-setuptools27. It turns out that there's a file there with a space in the filename. The filename was an argument for /usr/bin//file and it wasn't escaped. The file in question had parentheses too which the shell was trying to process. The fix was to escape the filename in the /usr/bin/file command. * The builders were mounting the source directory from "/usr/src", not $sysroot/usr/src as intended. This potentially causes breakage when the $sysroot reflects a different versions/release than the host machine has (e.g. making FreeBSD 10.2 packages on FreeBSD 11-current). Now the source directory mount is relative to profile's $sysroot.
Ada
isc
jrmarino/synth,jrmarino/synth,jrmarino/synth,jrmarino/synth
11273ac359e6d79c6e7efb1ede26b9bbfdd15083
awa/regtests/awa-commands-tests.ads
awa/regtests/awa-commands-tests.ads
----------------------------------------------------------------------- -- awa-commands-tests -- Test the AWA.Commands -- Copyright (C) 2020 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with Ada.Strings.Unbounded; package AWA.Commands.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test start and stop command. procedure Test_Start_Stop (T : in out Test); procedure Execute (T : in out Test; Command : in String; Input : in String; Output : in String; Result : out Ada.Strings.Unbounded.Unbounded_String; Status : in Natural := 0); end AWA.Commands.Tests;
----------------------------------------------------------------------- -- awa-commands-tests -- Test the AWA.Commands -- Copyright (C) 2020 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with Ada.Strings.Unbounded; package AWA.Commands.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test start and stop command. procedure Test_Start_Stop (T : in out Test); procedure Test_List_Tables (T : in out Test); procedure Execute (T : in out Test; Command : in String; Input : in String; Output : in String; Result : out Ada.Strings.Unbounded.Unbounded_String; Status : in Natural := 0); end AWA.Commands.Tests;
Declare the Test_List_Tables procedure to test the 'list -t' command
Declare the Test_List_Tables procedure to test the 'list -t' command
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
e223e201134ee99a44185842f8349f21c8b2bcae
regtests/security-testsuite.adb
regtests/security-testsuite.adb
----------------------------------------------------------------------- -- Security testsuite - Ada Security Test suite -- Copyright (C) 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Security.OpenID.Tests; with Security.Permissions.Tests; with Security.Policies.Tests; with Security.OAuth.JWT.Tests; package body Security.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Ret : constant Util.Tests.Access_Test_Suite := Tests'Access; begin Security.OAuth.JWT.Tests.Add_Tests (Ret); Security.OpenID.Tests.Add_Tests (Ret); Security.Permissions.Tests.Add_Tests (Ret); Security.Policies.Tests.Add_Tests (Ret); return Ret; end Suite; end Security.Testsuite;
----------------------------------------------------------------------- -- Security testsuite - Ada Security Test suite -- Copyright (C) 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Security.OpenID.Tests; with Security.Permissions.Tests; with Security.Policies.Tests; with Security.OAuth.JWT.Tests; with Security.OAuth.Clients.Tests; package body Security.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Ret : constant Util.Tests.Access_Test_Suite := Tests'Access; begin Security.OAuth.JWT.Tests.Add_Tests (Ret); Security.OpenID.Tests.Add_Tests (Ret); Security.Permissions.Tests.Add_Tests (Ret); Security.Policies.Tests.Add_Tests (Ret); Security.OAuth.Clients.Tests.Add_Tests (Ret); return Ret; end Suite; end Security.Testsuite;
Add the new unit tests
Add the new unit tests
Ada
apache-2.0
stcarrez/ada-security
8b2d4a837b9804f6a97f091c9580c6f19d5d9d00
mat/regtests/mat-testsuite.adb
mat/regtests/mat-testsuite.adb
----------------------------------------------------------------------- -- mat-testsuite - MAT Testsuite -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Readers.Tests; package body MAT.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Result : constant Util.Tests.Access_Test_Suite := Tests'Access; begin MAT.Readers.Tests.Add_Tests (Result); return Result; end Suite; end MAT.Testsuite;
----------------------------------------------------------------------- -- mat-testsuite - MAT Testsuite -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Readers.Tests; with MAT.Targets.Tests; package body MAT.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Result : constant Util.Tests.Access_Test_Suite := Tests'Access; begin MAT.Readers.Tests.Add_Tests (Result); MAT.Targets.Tests.Add_Tests (Result); return Result; end Suite; end MAT.Testsuite;
Add the new unit tests
Add the new unit tests
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
89671b58bfe23174debacc207afbb95060c27ee4
regtests/util_harness.adb
regtests/util_harness.adb
----------------------------------------------------------------------- -- Util -- Utilities -- Copyright (C) 2009, 2010 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Testsuite; with Util.Tests; procedure Util_Harness is procedure Harness is new Util.Tests.Harness (Util.Testsuite.Suite); begin Harness ("util-tests.xml"); end Util_Harness;
----------------------------------------------------------------------- -- Util -- Utilities -- Copyright (C) 2009, 2010 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Directories; with Util.Testsuite; with Util.Tests; with Util.Properties; procedure Util_Harness is procedure Initialize (Props : in Util.Properties.Manager); procedure Harness is new Util.Tests.Harness (Util.Testsuite.Suite, Initialize); procedure Initialize (Props : in Util.Properties.Manager) is pragma Unreferenced (Props); Path : constant String := Util.Tests.Get_Test_Path ("regtests/result"); begin if not Ada.Directories.Exists (Path) then Ada.Directories.Create_Directory (Path); end if; end Initialize; begin Harness ("util-tests.xml"); end Util_Harness;
Fix running the testsuite with AUnit: create the 'regtests/result' directory if it does not exist
Fix running the testsuite with AUnit: create the 'regtests/result' directory if it does not exist
Ada
apache-2.0
stcarrez/ada-util,stcarrez/ada-util
67f5cf9d4cbbd08eff3503e0f094e24a78aa60c1
regtests/security-permissions-tests.ads
regtests/security-permissions-tests.ads
----------------------------------------------------------------------- -- Security-permissions-tests - Unit tests for Security.Permissions -- Copyright (C) 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Security.Permissions.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test Add_Permission and Get_Permission_Index procedure Test_Add_Permission (T : in out Test); end Security.Permissions.Tests;
----------------------------------------------------------------------- -- Security-permissions-tests - Unit tests for Security.Permissions -- Copyright (C) 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Security.Permissions.Tests is package P_Admin is new Permissions.Definition ("admin"); package P_Create is new Permissions.Definition ("create"); package P_Update is new Permissions.Definition ("update"); package P_Delete is new Permissions.Definition ("delete"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test Add_Permission and Get_Permission_Index procedure Test_Add_Permission (T : in out Test); -- Test the permission created by the Definition package. procedure Test_Define_Permission (T : in out Test); -- Test Get_Permission on invalid permission name. procedure Test_Get_Invalid_Permission (T : in out Test); end Security.Permissions.Tests;
Add new unit tests to check the Permissions.Definition package
Add new unit tests to check the Permissions.Definition package
Ada
apache-2.0
stcarrez/ada-security
f9882b7793e2459ee9a53ca8f07f62eb19bc4c88
awa/plugins/awa-workspaces/src/awa-workspaces.ads
awa/plugins/awa-workspaces/src/awa-workspaces.ads
----------------------------------------------------------------------- -- awa-workspaces -- Module workspaces -- Copyright (C) 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- == Introduction == -- The *workspaces* plugin defines a workspace area for other plugins. -- -- == Data Model == -- @include Workspace.hbm.xml -- package AWA.Workspaces is end AWA.Workspaces;
----------------------------------------------------------------------- -- awa-workspaces -- Module workspaces -- Copyright (C) 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- == Introduction == -- The *workspaces* plugin defines a workspace area for other plugins. -- -- == Ada Beans == -- @include workspaces.xml -- -- == Data Model == -- @include Workspace.hbm.xml -- package AWA.Workspaces is end AWA.Workspaces;
Add the Ada beans in the workspace documentation
Add the Ada beans in the workspace documentation
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
1c583d65cb0a555f08a7e97508e428c44304a854
src/gen-commands.ads
src/gen-commands.ads
----------------------------------------------------------------------- -- gen-commands -- Commands for dynamo -- Copyright (C) 2011, 2012, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Commands.Drivers; with Gen.Generator; package Gen.Commands is package Drivers is new Util.Commands.Drivers (Context_Type => Gen.Generator.Handler, Driver_Name => "gen-commands"); subtype Command is Drivers.Command_Type; subtype Command_Access is Drivers.Command_Access; subtype Argument_List is Util.Commands.Argument_List; Driver : Drivers.Driver_Type; -- Print dynamo usage procedure Usage; -- Print dynamo short usage. procedure Short_Help_Usage; end Gen.Commands;
----------------------------------------------------------------------- -- gen-commands -- Commands for dynamo -- Copyright (C) 2011, 2012, 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Commands.Drivers; with Gen.Generator; package Gen.Commands is package Drivers is new Util.Commands.Drivers (Context_Type => Gen.Generator.Handler, Driver_Name => "gen-commands"); subtype Command is Drivers.Command_Type; subtype Command_Access is Drivers.Command_Access; subtype Argument_List is Util.Commands.Argument_List; Driver : Drivers.Driver_Type; -- Print dynamo short usage. procedure Short_Help_Usage; end Gen.Commands;
Remove the declaration of Usage procedure
Remove the declaration of Usage procedure
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
db6fcb876c53a3836c759d0c6d0f5dc9d6e7fe6f
src/util-commands.ads
src/util-commands.ads
----------------------------------------------------------------------- -- util-commands -- Support to make command line tools -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings.Vectors; package Util.Commands is subtype Argument_List is Util.Strings.Vectors.Vector; end Util.Commands;
----------------------------------------------------------------------- -- util-commands -- Support to make command line tools -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Util.Commands is -- The argument list interface that gives access to command arguments. type Argument_List is limited interface; -- Get the number of arguments available. function Get_Count (List : in Argument_List) return Natural is abstract; -- Get the argument at the given position. function Get_Argument (List : in Argument_List; Pos : in Positive) return String is abstract; end Util.Commands;
Change the Argument_List to an interface with a Get_Count and Get_Argument operation
Change the Argument_List to an interface with a Get_Count and Get_Argument operation
Ada
apache-2.0
stcarrez/ada-util,stcarrez/ada-util
322393f29a7d1bae390cef18fbcac3a7a8711d62
awa/plugins/awa-wikis/regtests/awa-wikis-modules-tests.ads
awa/plugins/awa-wikis/regtests/awa-wikis-modules-tests.ads
----------------------------------------------------------------------- -- awa-wikis-modules-tests -- Unit tests for wikis service -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; package AWA.Wikis.Modules.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with record Manager : AWA.Wikis.Modules.Wiki_Module_Access; end record; -- Test creation of a wiki space. procedure Test_Create_Wiki_Space (T : in out Test); -- Test creation of a wiki page. procedure Test_Create_Wiki_Page (T : in out Test); end AWA.Wikis.Modules.Tests;
----------------------------------------------------------------------- -- awa-wikis-modules-tests -- Unit tests for wikis service -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; package AWA.Wikis.Modules.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with record Manager : AWA.Wikis.Modules.Wiki_Module_Access; end record; -- Test creation of a wiki space. procedure Test_Create_Wiki_Space (T : in out Test); -- Test creation of a wiki page. procedure Test_Create_Wiki_Page (T : in out Test); -- Test creation of a wiki page content. procedure Test_Create_Wiki_Content (T : in out Test); end AWA.Wikis.Modules.Tests;
Add the Test_Create_Wiki_Content unit test
Add the Test_Create_Wiki_Content unit test
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
d26f95c8b01338ce7fa7f7e14db72b88fbad2356
awa/plugins/awa-changelogs/regtests/awa-changelogs-modules-tests.ads
awa/plugins/awa-changelogs/regtests/awa-changelogs-modules-tests.ads
----------------------------------------------------------------------- -- awa-changelogs-tests -- Tests for changelogs -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package AWA.Changelogs.Modules.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Add_Log (T : in out Test); end AWA.Changelogs.Modules.Tests;
----------------------------------------------------------------------- -- awa-changelogs-tests -- Tests for changelogs -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; package AWA.Changelogs.Modules.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with null record; procedure Test_Add_Log (T : in out Test); end AWA.Changelogs.Modules.Tests;
Fix the unit test to use AWA.Tests.Test for the correct test setup
Fix the unit test to use AWA.Tests.Test for the correct test setup
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
d0c1a2f378949a2f9bb5a29e019e408069cf82c6
awa/plugins/awa-sysadmin/src/awa-sysadmin.ads
awa/plugins/awa-sysadmin/src/awa-sysadmin.ads
----------------------------------------------------------------------- -- awa-sysadmin -- -- Copyright (C) 2019 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package AWA.Sysadmin is pragma Pure; end AWA.Sysadmin;
----------------------------------------------------------------------- -- awa-sysadmin -- sysadmin module -- Copyright (C) 2019, 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package AWA.Sysadmin is pragma Pure; end AWA.Sysadmin;
Fix style warnings: add missing overriding and update and then/or else conditions
Fix style warnings: add missing overriding and update and then/or else conditions
Ada
apache-2.0
stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa
4b6cb4655b33b7ccf6d41dc7ed0ab7fe9ca90042
testutil/aunit/util-test_caller.adb
testutil/aunit/util-test_caller.adb
----------------------------------------------------------------------- -- AUnit utils - Helper for writing unit tests -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Util.Test_Caller is procedure Add_Test (Suite : in Util.Tests.Access_Test_Suite; Test_Name : in String; Method : in Caller.Test_Method) is begin Suite.Add_Test (Caller.Create (Test_Name, Method)); end Add_Test; end Util.Test_Caller;
----------------------------------------------------------------------- -- AUnit utils - Helper for writing unit tests -- Copyright (C) 2009, 2010, 2011, 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Util.Test_Caller is procedure Add_Test (Suite : in Util.Tests.Access_Test_Suite; Test_Name : in String; Method : in Caller.Test_Method) is begin if Util.Tests.Is_Test_Enabled (Test_Name) then Suite.Add_Test (Caller.Create (Test_Name, Method)); end if; end Add_Test; end Util.Test_Caller;
Use the Is_Test_Enabled function to ignore or take into account the test when it is added in the testsuite.
Use the Is_Test_Enabled function to ignore or take into account the test when it is added in the testsuite.
Ada
apache-2.0
stcarrez/ada-util,stcarrez/ada-util
be9a12a2de15ff47e8e37350bdb9f8de0a307156
src/gen-commands-propset.ads
src/gen-commands-propset.ads
----------------------------------------------------------------------- -- gen-commands-propset -- Set a property on dynamo project -- Copyright (C) 2011, 2017, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Propset is -- ------------------------------ -- Propset Command -- ------------------------------ -- This command sets a property in the dynamo project configuration. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in out Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in out Command; Generator : in out Gen.Generator.Handler); end Gen.Commands.Propset;
----------------------------------------------------------------------- -- gen-commands-propset -- Set a property on dynamo project -- Copyright (C) 2011, 2017, 2018, 2019 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen.Commands.Propset is -- ------------------------------ -- Propset Command -- ------------------------------ -- This command sets a property in the dynamo project configuration. type Command is new Gen.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in out Command; Name : in String; Args : in Argument_List'Class; Generator : in out Gen.Generator.Handler); -- Write the help associated with the command. overriding procedure Help (Cmd : in out Command; Name : in String; Generator : in out Gen.Generator.Handler); end Gen.Commands.Propset;
Add Name parameter to the Help procedure
Add Name parameter to the Help procedure
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
51609ba9fcb7467fa3c4ae6f247d75c86158a0fe
src/gen.ads
src/gen.ads
----------------------------------------------------------------------- -- Gen -- Code Generator -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package Gen is -- Library SVN identification SVN_URL : constant String := "https://ada-gen.googlecode.com/svn/trunk"; -- Revision used (must run 'make version' to update) SVN_REV : constant Positive := 1095; end Gen;
----------------------------------------------------------------------- -- gen -- Code Generator -- Copyright (C) 2009, 2010, 2011, 2021 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; package Gen is -- Library SVN identification SVN_URL : constant String := "https://ada-gen.googlecode.com/svn/trunk"; -- Revision used (must run 'make version' to update) SVN_REV : constant Positive := 1095; subtype UString is Ada.Strings.Unbounded.Unbounded_String; function To_UString (Value : in String) return UString renames Ada.Strings.Unbounded.To_Unbounded_String; function To_String (Value : in UString) return String renames Ada.Strings.Unbounded.To_String; function Length (Value : in UString) return Natural renames Ada.Strings.Unbounded.Length; function "=" (Left, Right : in UString) return Boolean renames Ada.Strings.Unbounded."="; function "=" (Left : in UString; Right : in String) return Boolean renames Ada.Strings.Unbounded."="; end Gen;
Declare the UString subtype to simplify the implementation and use of Unbounded_String
Declare the UString subtype to simplify the implementation and use of Unbounded_String
Ada
apache-2.0
stcarrez/dynamo,stcarrez/dynamo,stcarrez/dynamo
bea375106da24b7c7cb8af2fb789fd15ccafe787
mat/src/mat-formats.ads
mat/src/mat-formats.ads
----------------------------------------------------------------------- -- mat-formats - Format various types for the console or GUI interface -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Types; package MAT.Formats is -- Format the address into a string. function Addr (Value : in MAT.Types.Target_Addr) return String; -- Format the size into a string. function Size (Value : in MAT.Types.Target_Size) return String; end MAT.Formats;
----------------------------------------------------------------------- -- mat-formats - Format various types for the console or GUI interface -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with MAT.Types; package MAT.Formats is -- Format the address into a string. function Addr (Value : in MAT.Types.Target_Addr) return String; -- Format the size into a string. function Size (Value : in MAT.Types.Target_Size) return String; -- Format a file, line, function information into a string. function Location (File : in Ada.Strings.Unbounded.Unbounded_String; Line : in Natural; Func : in Ada.Strings.Unbounded.Unbounded_String) return String; end MAT.Formats;
Declare the Location function to format a file,line,function code location
Declare the Location function to format a file,line,function code location
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
560eff37d2893ed598e42721e862521e5b653bf5
mat/src/mat-formats.adb
mat/src/mat-formats.adb
----------------------------------------------------------------------- -- mat-formats - Format various types for the console or GUI interface -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body MAT.Formats is -- ------------------------------ -- Format the address into a string. -- ------------------------------ function Addr (Value : in MAT.Types.Target_Addr) return String is Hex : constant String := MAT.Types.Hex_Image (Value); begin return Hex; end Addr; end MAT.Formats;
----------------------------------------------------------------------- -- mat-formats - Format various types for the console or GUI interface -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body MAT.Formats is -- ------------------------------ -- Format the address into a string. -- ------------------------------ function Addr (Value : in MAT.Types.Target_Addr) return String is Hex : constant String := MAT.Types.Hex_Image (Value); begin return Hex; end Addr; -- ------------------------------ -- Format the size into a string. -- ------------------------------ function Size (Value : in MAT.Types.Target_Size) return String is Result : constant String := MAT.Types.Target_Size'Image (Value); begin if Result (Result'First) = ' ' then return Result (Result'First + 1 .. Result'Last); else return Result; end if; end Size; end MAT.Formats;
Implement the Size function to format sizes
Implement the Size function to format sizes
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
8394c019a158014ea7d09749006d2ba48c358c14
mat/src/matp.adb
mat/src/matp.adb
----------------------------------------------------------------------- -- mat-types -- Global types -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.IO_Exceptions; with Readline; with MAT.Commands; with MAT.Targets; procedure Matp is procedure Interactive_Loop is Target : MAT.Targets.Target_Type; begin loop declare Line : constant String := Readline.Get_Line ("matp>"); begin MAT.Commands.Execute (Target, Line); exception when MAT.Commands.Stop_Interp => return; end; end loop; exception when Ada.IO_Exceptions.End_Error => return; end Interactive_Loop; begin Interactive_Loop; end Matp;
----------------------------------------------------------------------- -- mat-types -- Global types -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.IO_Exceptions; with Readline; with MAT.Commands; with MAT.Targets; with Util.Log.Loggers; procedure Matp is procedure Interactive_Loop is Target : MAT.Targets.Target_Type; begin loop declare Line : constant String := Readline.Get_Line ("matp>"); begin MAT.Commands.Execute (Target, Line); exception when MAT.Commands.Stop_Interp => return; end; end loop; exception when Ada.IO_Exceptions.End_Error => return; end Interactive_Loop; begin Util.Log.Loggers.Initialize ("matp.properties"); Interactive_Loop; end Matp;
Use Util.Log.Loggers.Initialize to configure the loggers
Use Util.Log.Loggers.Initialize to configure the loggers
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
74816706bdf72c1c44fe655232dbf4ee092a5827
mat/src/mat-readers-streams.ads
mat/src/mat-readers-streams.ads
----------------------------------------------------------------------- -- mat-readers-streams -- Reader for streams -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; package MAT.Readers.Streams is type Stream_Reader_Type is new Manager_Base with private; -- Read the events from the stream and stop when the end of the stream is reached. procedure Read_All (Reader : in out Stream_Reader_Type); -- Read a message from the stream. overriding procedure Read_Message (Reader : in out Stream_Reader_Type; Msg : in out Message); private type Stream_Reader_Type is new Manager_Base with record Stream : Util.Streams.Buffered.Buffered_Stream; Data : Util.Streams.Buffered.Buffer_Access; end record; end MAT.Readers.Streams;
----------------------------------------------------------------------- -- mat-readers-streams -- Reader for streams -- Copyright (C) 2014 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Streams.Buffered; with MAT.Events.Probes; with MAT.Events.Targets; package MAT.Readers.Streams is type Stream_Reader_Type is new MAT.Events.Probes.Probe_Manager_Type with private; -- Read the events from the stream and stop when the end of the stream is reached. procedure Read_All (Reader : in out Stream_Reader_Type); -- Read a message from the stream. overriding procedure Read_Message (Reader : in out Stream_Reader_Type; Msg : in out Message_Type); private type Stream_Reader_Type is new MAT.Events.Probes.Probe_Manager_Type with record Stream : Util.Streams.Buffered.Buffered_Stream; Data : Util.Streams.Buffered.Buffer_Access; end record; end MAT.Readers.Streams;
Use the Message_Type and MAT.Events.Probes.Probe_Manager_Type types
Use the Message_Type and MAT.Events.Probes.Probe_Manager_Type types
Ada
apache-2.0
stcarrez/mat,stcarrez/mat,stcarrez/mat
End of preview. Expand in Data Studio

huihui-ai/commitpackft_merged

This dataset is a copy of bigcode/commitpackft

The records where old_contents is empty have been removed.

Downloads last month
29