Skip to content

Commit 1fa795f

Browse files
Add files via upload
1 parent 118bbf1 commit 1fa795f

File tree

4 files changed

+474
-0
lines changed

4 files changed

+474
-0
lines changed

examples/List/List.ino

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/***************************************************
2+
Copyright (c) 2017 Luis Llamas
3+
(www.luisllamas.es)
4+
5+
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
6+
7+
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
8+
****************************************************/
9+
10+
#include "ListLib.h"
11+
12+
void setup() {
13+
Serial.begin(9600);
14+
15+
// Crear una nueva lista
16+
List<int> list;
17+
18+
// Añadir elementos de 0 a 10
19+
for (int i = 0; i <= 10; i++)
20+
{
21+
list.Add(i);
22+
}
23+
24+
// Array para ejemplos con rangos
25+
int test[] = {100, 200, 300, 400, 500 };
26+
27+
// Ejemplo añadir
28+
list.Add(1000);
29+
list.AddRange(test, 5);
30+
31+
// Ejemplo insertar
32+
list.Insert(2, 2000);
33+
list.InsertRange(5, test, 5);
34+
35+
// Ejemplo reemplazar
36+
list.Replace(2, 5000);
37+
list.ReplaceRange(3, test, 5);
38+
39+
// Ejemplo de eliminar
40+
list.Remove(17);
41+
list.RemoveRange(2, 8);
42+
43+
// Mostrar resultado por pantalla
44+
// y ejemplo acceso con indexador[]
45+
for (int i = 0; i < list.Count(); i++)
46+
{
47+
Serial.println(list[i]);
48+
}
49+
50+
// Ejemplo IndexOf
51+
Serial.print("IndexOf: ");
52+
Serial.println(list.IndexOf(23));
53+
54+
// Ejemplo Trim
55+
list.Trim();
56+
Serial.print("Capacity: ");
57+
Serial.println(list.Capacity());
58+
}
59+
60+
void loop() {
61+
62+
}

keywords.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#######################################
2+
# Syntax Coloring Map List
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
List KEYWORD1
9+
10+
#######################################
11+
# Methods and Functions (KEYWORD2)
12+
#######################################
13+
Capacity KEYWORD2
14+
Count KEYWORD2
15+
Contains KEYWORD2
16+
IndexOf KEYWORD2
17+
First KEYWORD2
18+
Last KEYWORD2
19+
Add KEYWORD2
20+
AddRange KEYWORD2
21+
Insert KEYWORD2
22+
InsertRange KEYWORD2
23+
RemoveFirst KEYWORD2
24+
Remove KEYWORD2
25+
RemoveLast KEYWORD2
26+
RemoveRange KEYWORD2
27+
Replace KEYWORD2
28+
ReplaceRange KEYWORD2
29+
Reverse KEYWORD2
30+
Clear KEYWORD2
31+
IsEmpty KEYWORD2
32+
IsFull KEYWORD2
33+
Trim KEYWORD2
34+
ToArray KEYWORD2
35+
CopyTo KEYWORD2
36+
FromArray KEYWORD2
37+
38+
#######################################
39+
# Constants (LITERAL1)
40+
#######################################

library.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=ListLib
2+
version=1.0.0
3+
author=Luis Llamas
4+
maintainer=Luis Llamas
5+
sentence=ListLib Library
6+
paragraph=
7+
category=Other
8+
url=https://www.luisllamas.es
9+
architectures=*

0 commit comments

Comments
 (0)